I would like to set date to default time zone. At this moment my date looks like this: 2013-04-08T22:00:00 +02:00. I need to set my date to +00:00.
I tried to get the offset of my date and I received -120. Is it possible to set time offset? Are there maybe any better solutions?
Anybody an idea?
I'm using EXT JS.
JavaScript's Date object is bound to the time zone of the computer itself. There is no way to change the zone offset programmatically to an arbitrary value.
There is some work going on to add this functionality to the Moment.js library, but it is still in progress.
If you are just looking to get the time at UTC in ISO format, you can use .toISOString()
If you are speaking about code that is specific to the Ext.Date object from ExtJS, please edit your question and post some sample code so we can get a better idea of what you are talking about. Thanks.
Related
I need to configure Statsig flag to return true for 30 days, by setting from and to dates
I am using "check time and date" and I am trying to set before and after time. But its giving invalid error. Not sure what is the mistake. Please guide to resolve this issue
Statsig uses American formats for dates - so MM/DD/YYYY, and XX:XX AM/PM
I think the UI should have a datepicker which enforces this. Here's what mine looks like
I am fetching a datetime value from the back end and I use the following line of code to get the time apart from the date :
{moment(element.dateTime).format('h:mm:ss a')}
I just want to know how to adjust the time zone in the code above to be the same as my country's time zone. Is there a way to achieve this?
Thanks in advance.
Moment by default will parse the date to your local computer. https://momentjs.com/guides/#/parsing/local-utc-zone/
You can use the utcOffset method as below, it takes the GMT Offset value. Change '+05:30' to whatever value you want
{moment.utc(element.dateTime).utcOffset("+05:30").format('h:mm:ss a')}
Also, Moment by default parses the date to your local timezone.
You can also use moment-timezone for timezone purposes, it asks for timezone name instead of gmtOffset. If you wish to use format method of moment though, there are certain limitations to it.
Moment Timezone
I am working on a news blog mobile app using wordpress WP-API, everything else is working ok, but am having problem formatting the wordpress post date
this {{post.date}} gives me something like2016-08-07T15:45:26
How ever I want to format the date to have something like dd-mm-year, then in another one I get the time, instead of 15:45:26, I want to get something like 3:45 pm.
If possible, I will also like a filter that returns the date 2016-08-07T15:45:26 to something like 24 hours ago, 2 days ago, 1 week ago etc
Thanks
Had the same problem too. You may want to check this
:https://weblog.west-wind.com/posts/2014/jan/06/javascript-json-date-parsing-and-real-dates
You could use a date manipulation library to convert the datetime provided by WordPress to the desired format. You may want to check out Moment.js.
First time Qlikview user here. Trying to get x-axis only showing the date from the timestamp. Here is the example,
It would be lovely to be able to remove the time. Does anybody know how to do this? I tried some simple script in the Used Dimension section under Dimension tab hoping to get only the date. It didn't work. It looked like this:
=date(floor(timestamp#(SomeDate,'MM/DD/YYYY hh:mm:ss'))) as record_date
Please help!
If you need to remove time than you rather use Date# function instead of timestamp#?
Below one is the sample one:-
Date#( DateField, 'M/D/YY')
I need to use Jalali (Persian) date type on dhtmlxGantt
and I changed some methods on the source file, so when I'm using scale time to month or year it doesn't work.
Is there a way to do that?
I think with https://github.com/jalaali/moment-jalaali you can use Jalali date for your app.