Advertisement
basyair07

datetime_realtime

Aug 6th, 2022
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  var { DateTime } = require("luxon");
  2.  
  3.   function DateTimeBot(){
  4.     var local = DateTime.local();
  5.     var rezonedString = local.setZone("Asia/Jakarta");
  6.    
  7.     // get Date
  8.     let year = rezonedString.c.year;
  9.     let month = rezonedString.c.month;
  10.     let day = rezonedString.c.day;
  11.    
  12.     // get Time
  13.     let hour = rezonedString.c.hour;
  14.     let minute = rezonedString.c.minute;
  15.     let second = rezonedString.c.second;
  16.    
  17.     let datetime = year+"/"+month+"/"+day+" ("+hour+":"+minute+":"+second+")";
  18.     return datetime;
  19.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement