Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const offset = 10800;
- const now = new Date();
- const date = new Date(now.getTime() + (now.getTimezoneOffset() * 60000) + (offset * 1000));
- const formattedDate = date.toLocaleString('en-us', { weekday: 'long', month: 'long', day: 'numeric', year: 'numeric', hour: 'numeric', minute: 'numeric' });
- console.log(formattedDate);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement