Avatar

Level 8

Hello

With the below code, am getting current date and time, fine

 

 

var date = new Date();

 

time = date.getHours();

 

time = time + ":" + date.getMinutes() + ":" + date.getSeconds()

I am getting the output as below,

16:3:24

But, i want like below

16:03:24 EST ......I mean, i need the below enhancements

1) Minutes should come with PREFIX ZERO if minutes are lesss than 10

2) Most importanlty, i need DAY LIGHT ZONE, like Eastern Time, Central time, Pacific time etc.

Pls. let me know in JavaScript?

Thank you