0

Though support may be limited, is there a way to parse a datetime string to utc/unix (locale & time zone aware) in new Intl (http://www.ecma-international.org/ecma-402) spec, something similar using moment

http://momentjs.com/timezone/docs/, http://momentjs.com/docs/

var newYork    = moment.tz("2014-06-01 12:00", "America/New_York");
var unix = newYork.valueOf();

note: I haven't tried above, but reading the API, I think this may be a way.

Edit: the question was a specific instance of internationalization as I wanted to parse user input in a locale aware manner. Example, numbers (1,000 and 1.000 may be equal depending on locale). same way user may enter time as lundi 27 juin 2016 10:15 in dt picker/text field, which needed to be parsed.

bsr
  • 57,282
  • 86
  • 216
  • 316
  • Possible duplicate: http://stackoverflow.com/questions/221294/how-do-you-get-a-timestamp-in-javascript. Is this what you are looking for? – andybeli Jun 27 '16 at 13:59
  • actually, the question was a specific instance of internationalization as I wanted to parse user input in a locale aware manner. Example, numbers (1,000 and 1.000 may be equal depending on locale). same way user may enter time as `lundi 27 juin 2016 10:15` in dt picker/text field, which needed to be parsed. – bsr Jun 27 '16 at 14:16

0 Answers0