无法使用pandas包将日期对象转换为字符串。我已经尝试过void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return StreamProvider<FirebaseUser>( //From the Provider package
stream: FirebaseAuth.instance.onAuthStateChanged,
child: MaterialApp(
home: MyScreen(),
),
);
}
}
class MyScreen extends StatelessWidget {
Widget build(BuildContext context) {
FirebaseUser fbUser = Provider.of<FirebaseUser>(context); // this is how you can access the user from anywhere in the app
return Scaffold(body: Container(child: Text(fbUser.uid ?? "No user"),),);
}
}
,但我确定这不是熊猫的一部分。
onAuthStateChanged
日期打印-
date[0].strftime("%Y-%m-%d")
答案 0 :(得分:0)
由于列表中有tuple
,因此可以调用next(iter())
访问元组,然后调用第0
个索引访问datetime
值。需要:
#date=[(datetime.date(2019, 6, 6),)]
next(iter(date))[0].strftime("%Y-%m-%d")
#'2019-06-06'