PAW: Replace timestamp from response with date time Or any API for that? - paw-app

Still not have any idea for convert integer value to date time string in PAW?
Like 1574320970183 to "Thu Nov 21 2019 16:22:50 GMT+0900"
Or is there an API for replace that?
same question has no anwser

Related

What date format is "623548800"?

I exported the SQLite db from an iOS app and was wanting to run a query based on the date, but I found that it's in a format I don't recognize. As stated above, the latest value is "623548800". I'm assuming this corresponds to today, since I created a record in the app today. This is 9 digits, so it's too short to be a Unix timestamp, which is 10 digits.
The earliest record in the db is "603244800", which likely corresponds to when I started using the app on 2/13/2020. That's a difference of 20,304,000, so it looks like it's using seconds, as it's been 20,312,837 seconds since then.
Is this essentially tracking seconds based on some proprietary date, or is this a known format?
623548800 - 603244800 = 20304000
20304000/86400 seconds in 24 hours = 235 days
October 5, 2020 - February 13, 2020 = 235 days
UTC Unix timestamp February 13, 2020 = 1581552000
Like the prior comment said it looks like an offset, it might be a timestamp somewhere in source or in db
Your dates are Unix Timestamps.
By using any on line converter (like https://www.epochconverter.com) you can find the dates they correspond to.
The latest value 623548800 corresponds to Thursday, October 5, 1989 12:00:00 AM GMT
and the earliest value 603244800 corresponds to Sunday, February 12, 1989 12:00:00 AM GMT.
So it seems like your dates or off by 31 years.
I found a similar case here: Behind The Scenes: Core Data dates stored with 31 year offset?
If you want you can convert them to the format 'YYYY-MM-DD hh:mm:ss' like this:
UPDATE tablename
SET datecolumn = datetime(datecolumn, 'unixepoch', '+31 year')
or:
UPDATE tablename
SET datecolumn = date(datecolumn, 'unixepoch', '+31 year')
if you are not interested in the time part.

convert date from DateBox to simpleDate and get year in app maker

as the title says, is it possible to parse the Date from a DateBox (for example Tue Sep 17 2019 00:00:00 GMT+0200 (CEST)) to a simple date format like 2019/09/17? And also get the year value from the date alone (2019)?

Random TMZ on a dateTime [Spreadsheet]

I have a starting time in "HH:MM:SS" format. In my spreadsheet, the user enters it in this format, like "09:00:00" for 9AM. When I get this cell's value in my script, I get this weirdo :
"Sat Dec 30 09:00:00 GMT+00:09 1899"
It seems like I have that random date of Sat Dec 30 1899, which I don't really care about, but also the "GMT+00:09", that bothers me a lot more. My spreadsheet and script are "GMT+01:00 Paris", so when I insert this data elsewhere, I get 09:50 GMT+01:00... Not even 51 minutes off, as I would have expected.
Do you have any idea how and why it happens ?
The fix I use right now is to display the time in my "HH:MM:SS" format, or "HH:MM", but set the value to, say "05/01/2018 09:00:00", so it is considered a full dateTime in my timezone. I would really like to be able to only specify the time here.
Thanks for your answers,
How about this answer? This answer supposes the following condition.
Format of cell "A1" is HH:MM:SS for time.
Value of cell "A1" is 09:00:00.
In your 1st case :
When the value of "A1" is retrieved by getValue(), the value is Sat Dec 30 09:00:00 GMT+09:00 1899. (I'm sorry. "GMT+09:00" is due to the time zone. My time zone is Asia/Tokyo.) Because Spreadsheet uses Serial Number for Date/Time. The start of serial number is 12/30/1899 00:00:00. In this case, because there are no date information, Sat Dec 30 09:00:00 GMT+09:00 1899 is retrieved as the value which elapsed for 09:00:00 from the start.
If you want to retrieve 09:00:00 from cell "A1", please use getDisplayValue() instead of getValue(). By this, you can retrieve 09:00:00.
In your 2nd case :
I think that this is better usage. 05/01/2018 09:00:00 is imported to the cell with the format of HH:MM:SS. By this, the value has the information of both date and time. So the values of cell retrieved by getValue() and getDisplayValue() are Fri Jan 05 09:00:00 GMT+09:00 2018 and 09:00:00, respectively.
Sample :
In the case using getValue()
SpreadsheetApp.getActiveSheet().getRange("A1").getValue();
In the case using getDisplayValue()
SpreadsheetApp.getActiveSheet().getRange("A1").getDisplayValue();
References :
getValue()
getDisplayValue()
Date/Time serial numbers
If I misunderstand your question, I'm sorry.

convert another timezone time to local time in momentjs

I want to convert Fiji(Pacific/Fiji) time to my local time.
suppose,
I have Fiji(Pacific/Fiji) time "Thu, 10 November 2016 03:47" PM and I am in India then convert it in India(Asia/Kolkata) time "Thu, 10 November 2016 08:17 AM".
so, question is
which time string need for Fiji? and how to convert it to local time in moment.js?
need to UTC string like 2016-11-16T06:30:00.000Z
working fiddel here:
http://jsfiddle.net/d06047c5/

Convert data in milliseconds to date in ext-js without timezone

In ext-js ,
I have a data in millseconds ..eg;850248000000 for DOB field.
it is what i get from server side.
I need to convert this to Date format to be shown in a browser.
Time Zone at the Client Side should not affect the conversion.
Appreciate your help.
kp
The first thing to know would be what the time means(thanks #Teo). If it's epoch time in ms, the following might work for you
var d = new Date(850248000000)
console.log(d.toGMTString())
>>>Tue, 10 Dec 1996 20:00:00 GMT VM309:2
console.log(d.toLocaleString())
>>>12/10/1996 3:00:00 PM VM310:2

Resources