I've read the documentation as best as I can but cannot work this out.
I have a date/time I'm getting from Bootstrap DateTime Picker that is an ISO 8601 string like this:
2016-04-01T22:00:00+01:00
That string is the result of picking the 1st of April at 10pm in the date/time picker.
I want to convert that to a unix timestamp to store in the db
When I use:
moment(date).format('X')
I get the following unix timestamp: 1459544400
This correlates to 2016-04-01T21:00:00+00:00
which is 1 hour behind the time I picked. No matter what I do, I can't seem to get the unix timestamp to take the offset in to account. Can anyone help me and tell me what I am missing here?
Many thanks in advance!