To create a moment from the current date, simply use moment() without any parameters.
var m = moment();
If you want to format it using the proprietary format /Date()/ for MS, you can use:
m.format("/[Date](XSSS)/")
This will give you a value, such as /Date(1372728650261)/ , which is suitable for going into .Net and ultimately will give you a DateTime object where .Kind is Utc .
If you need an extended format with an offset, you can use this:
m.format("/[Date](XSSSZZ)/")
And it will return a value to you, e.g. /Date(1372728650261-0700)/ . This complies with the requirements of the DataContractJsonSerializer class in .Net. See the "DateTime Date Format" section in these documents .
However, I highly recommend that you do not use this latter format. It is only recognized by the DataContractJsonSerializer , and the docs explicitly state that any offset you provide will be ignored - it uses its own server offset instead. This is pretty stupid, but what he does. If you use the JavaScriptSerializer class, the offset is also ignored, but it has a different behavior than DCJS (staying with UTC instead of going locally).
In this regard, I would recommend completely abandoning this strange format. Use the ISO8601 standard instead (e.g. 2013-07-01T18:38:29-07:00 ). This is easy to do using momentjs and is a standard format.
moment().format() // it the default, no need to specify anything.
On the server side, use JSON.Net , which also uses this default format. And if you really care about the offset, use the DateTimeOffset type on the server instead of the DateTime type.