Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I am using moment JS to handle my dates.

Setup :

One DateTime input element One Time Input Element

Lets says I have these values :

DateTime = "05/30/2016" and StartTime = "10:00";

I am doing this to convert from local time to UTC time :

utcTime = moment(DateStart+ " " + StartTime).toDate().toISOString(),

but when print the utcTime value I am getting, "2016-05-30T10:00:00+01:00" That +01:00 , is messing up my time when passing it back to the server (hosted in the same machine as the client, development machine) when I get the data back in the server it reports back as 9H instead of 10H , due to the +1 offset. My time zone is set to 0 (LISBON timezone), so the offset should be 0.

Is there something that I am missing?

share|improve this question
    
Why don't you just remove the +01:00 from the string doing a simple regular expression before you send it back to the server?? – Santiago Bendavid 15 mins ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.