Does this time format look familiar? - datetime

Can someone help me tell what datetime format is this, or what are it's parts?
e.g.
201106020539Z0000031552001001
201106020702Z0000000000001
201105140701Z0000000000001
201105170207A0000018560001001
I think I've got the first few parts (201106020539 is yyyymmddhhmm), but from the Z / A character onward, I have no clue. Is it possible that the rest isn't a datetime at all?

The Z implies Zulu or UTC time https://meta.stackexchange.com/questions/14684/so-html-formats-time-incorrectly, as for what comes after, I don't know since all other time data has already been indicated prior to the Timezone Character.
Also, the fact that your timestamps don't seem to end in the same number of characters suggests they might not be the same format/spec? Where did you obtain them?

In which context did you get these strings? I would guess that the digits are the seconds fractions.
Maybe this helps you:
For a UTC time (a DateTime.Kind
property value of DateTimeKind.Utc),
the result string includes a "Z"
character to represent a UTC date.

Related

Return wrong date in moment js with full format "DD-MM-YYYYTHH:mm:SSZ"?

I'm using momentjs to convert String to date in with full value of date and time and the result always increases about 12 hours. just like the picture below.
So how come does it go like this and how I can do to solve the problem. Many thanks.
"Z" at the end indicates that the date is provided with UTC-0 zone. momentjs internally shifts the timezone to suit your own. You should omit it if you want to reformat provided datetime string.

Two datetime formatting strings in one vector

i have a large structure dataset.
each field in the structure is a XXXX*4 cell. the XXXX are because they are not constant in size. the first column is datetime.
the problem is that part of the vector is in the format of: '1/9/2015 00:00:00' that is dd/MM/yyyy HH:mm:ss
while the other part is in the format of '1/9/2015 00:00' that is dd/MM/yyyy HH:mm.
this change can happen more then once in each date vector.
is there any way to call the datetime function with two format types? or a general one that covers both of these?
for lack of a better option i would scan each row, and fix it, but it would take a lot of time. hope someone can help... thanks.
well, i just made a for loop, and wrote this inside:
s=fieldnames(DataSet);
for i=1:length(fieldnames(DataSet))
for j=2:(length(DataSet.(s{i})))
if length(DataSet.(s{i}){j,1})>=17
DataSet.(s{i}){j,1}=DataSet.(s{i}){j,1}(1:(length(DataSet.(s{i}){j,1})-3));
end
end
end
it worked. actually pretty fast, only took 7 seconds (i was a bit surprised)
notice it only works to change from 'dd/MM/yyyy HH:mm:ss' to 'dd/MM/yyyy HH:mm'.
but i guess you can manipulate it to adjust most types.

Mismatch when converting unix timestamp to date

I have a database (in CSV) with unix timestamps. I try to convert them in LibreOffice Calc into a human readable date. Everything is ok... except a one-day-lag.
For example, my timestamp is -518144400 (in E2 cell).
My function is : =E2/86400+DATEVAL("1/1/1970").
I obtain 19572,9583333333 which correspond to 1953-07-31.
This on-line calculator confirm the result.
What is the problem ? Just that the right answer is 1953-08-01.
First, I thought the timestamps contained a mistake. But, in this PHP calendar, if I paste -518144400 as parameter in the URL, it works. The on-line calendar associate this timestamp to (what I think is) the right answer.
I don't understand what happens. What I missed ?
One solution could be adding +1 in my function to correct. But I'm not satisfied, I'd like to understand...
It depends on conversion time zone, I mean that -518144400 (Timestamp) is equal to 1953-07-31 in GMT
While it will be 1953-08-01 in all other Time Zone where Time Relative to GTM is +1 or more.

How to convert date and time into a numeric value

As a new and self taught R user I am struggling with converting date and time values characters into numbers to enable me to group unique combinations of data. I'm hoping someone has come across this before and knows how I might go about it.
I'd like to convert a field of DateTime data (30/11/2012 14:35) to a numeric version of the date and time (seconds from 1970 maybe??) so that I can back reference the date and time if needed.
I have search the R help and online help and only seem to be able to find POSIXct, strptime which seem to convert the other way in the examples I've seen.
I will need to apply the conversion to a large dataset so I need to set the formatting for a field not an individual value.
I have tried to modify some python code but to no avail...
Any help with this, including pointers to tools I should read about would be much appreciated.
You can do this with base R just fine, but there are some shortcuts for common date formats in the lubridate package:
library(lubridate)
d <- ymd_hms("30/11/2012 14:35")
> as.numeric(d)
[1] 1921407275
From ?POSIXct:
Class "POSIXct" represents the (signed) number of seconds since the
beginning of 1970 (in the UTC timezone) as a numeric vector.

What date format is this?

I exported my Firefox bookmarks, and the 'dateAdded' fields look like this:
1260492675000000
1260492675000000
1266542833000000
They're too big to be a Unix timestamp, and I can't make sense of them. What are they? (I want to convert it into something usable/readable.)
It is PRTime.
This type is a 64-bit integer representing the number of microseconds since the NSPR epoch, midnight (00:00:00) 1 January 1970 Coordinated Universal Time (UTC). A time after the epoch has a positive value, and a time before the epoch has a negative value.
PRTime as described on this page.
You can extract the time using the f3e tool if you can find a link to it.

Resources