I am in EDT and my end user is in PDT. I would like to operate my webpage as if it was an end user Is running in the timezone of time (eg, if they travel then this house is to show time back). The timestamp coming from the Java server is formatted to include the end user's timezone eg. "Mon Oct 27 06:57:00 PDT 2014", and I have the end user TZ string eg In a config file "America / Vancouver" I am using the original date () and it is showing the right time for the user, but I can not use it to compare time with the client in the moment I want to change in JS, but I can not understand what I want to do. Basically, looking at the above timestamp, I want to be able to call m.hour () and get 6 backs. I also want to be able to get the end of the year at user time (both for "now" and a timestamp), and see how far the last timestamp is from the present time, in minutes Here's my failed attempt:
var d = "Mon Oct 27 06:57:00 PDT 2014"; Var ds = dsprist (/) Piece (1) .joint (''); // eat "Som" var M = moment.tz (DS, "MMM DHH: MM: SS ZYYYY", "America / Vancouver"); Warning ("" + .hur ()); // 23 ??? "6" want! Var n = moment.tz ("America / Vancouver"); Var df = n.diff (m, 'min'); Warning (M.format) + "\ n" + n.format () + "\ n" + DF + "minutes ago"); Use lower-case z
in the format string instead of
> upper-case Z
Will match up. Note that this will not actually interpret the shortened form as a special offset. This is primarily because the compression can be unclear. (). Because of this, some values may be interpreted incorrectly during some time. For example, in the Pacific time zone, there are 2 examples on November 2, 2014 at 1:00 AM. The first is in PDT (- 7), and the second is in PST (-8). Even if you have provided a brief, the moment not will have to be used to use it. If you want some examples in which you are working, you will need a numeric time zone offset to be included and parsed with the Z
.
In addition to this, you have the Deed
for the name of the week instead of the split and the slice.
Comments
Post a Comment