Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. // Prints a greeting.
  2. void main() {
  3. DateTime now = new DateTime.now();
  4. print(now);
  5. print(now.isUtc);
  6. print(now.toLocal());
  7. print(now.toUtc());
  8.  
  9. DateTime n1 = now.toUtc().add(new Duration(hours: -5));
  10. print(n1);
  11.  
  12. DateTime utc = new DateTime.utc(1945, 2, 6);
  13. DateTime loc = new DateTime(1945, 2, 6);
  14.  
  15. print(utc);
  16. print(loc);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement