angular-moment-picker icon indicating copy to clipboard operation
angular-moment-picker copied to clipboard

momentDate set timezone

Open rajithwijepura opened this issue 6 years ago • 2 comments

Hi, is there a way to set timezone for the momentDate? I'm in GMT+5.30.

Thanks

rajithwijepura avatar Mar 23 '18 04:03 rajithwijepura

Yes, to set "literally" a timezone, you need the "tz" method (additional) from moment,js. Documentation: https://momentjs.com/timezone/docs/

reidark avatar Apr 20 '18 21:04 reidark

I have the same problem right now. The users can pick their birthday. The user picks the date, the model value will be set the selected date with time (00:00:00) and timezone so when I send it to my database the day will be one less than hat I've sent. I'm in GMT the server is in UTC, so that's why. I can fix this by handling the date as a string instead of a date object so the timezone won't be changed, but this shouldn't be the right way to store the sent data. I would like to overwrite that, the default timezone is the client's timezone, I would like to force a static timezone instead. How can I do that through angularjs?

Thank you

csimpi avatar Jan 21 '19 18:01 csimpi