Reputation: 4196
With TimeOfDay.now()
we can get the actual time, but how can we create a variable with a different time, like 12:00
for example?
I need to be able to select a DateTime manually but by default, I need to display 12pm.
Upvotes: 2
Views: 1317
Reputation: 27197
Using String you can set custom time in following manner.
var moonLanding = DateTime.parse("2020-02-10 12:00:00Z");
print(moonLanding.hour);
Upvotes: 1