Convert Exif date to different format - rest

I am getting an exif date value like
EXIFPhotoDate: 1506173228000 and
UploadDate: 1506485214000
but I know it is
EXIFPhotoDate 23/9/2017, 23:27 and
UploadDate 9/27/2017, 01:59
The former is when queried via REST and the latter is when queried via the table.
How can I get standard date/time from a value like this?

Looks like you have a number of milliseconds since January 01 1970 in UTC. If you remove the 000 from the end, you will have a Unix timestamp, that is, the number of seconds since January 01 1970 in UTC:
unixTimestamp = 1506173228000 / 1000
Once your question doesn't state any programming language, it's hard to give you further help.

Related

In what format is this time: 568399396

in my current project I need to work with data from a certain loger. Unfortunately, I encountered a problem of coding the date of this loger. I believed that it is a timestamp date format but it is not. Can you tell me in what format is this datum
Real date:
04-Jan-2018 16:43:16
Date format:
568399396
That date-time format is called epoch, where the date is stored as an integer. It is the number of seconds/milliseconds after 1st January 1970, 00:00:00. This is how all the computers/devices store the date/time internally.
You can use n number of libraries to convert an epoch to date/time etc.
You can read more about epoch here:
https://en.wikipedia.org/wiki/Unix_time
P.s.: Are you sure that you're getting this number for 4th Jan 2018? The epoch of 04-Jan-2018 16:43:16 will be 1515064396000(in ms)

Understanding this date format - Redtail

What date format is this: -147114000000-0700. It is supposed to be 05/04/1965.
The first term looks like a unix timestamp. But then why would we need the second term?
I am using Redtail's api, but they provide negligible documentation on this. They are sending over a date looking like "/Date(-147114000000-0700)/". I have never seen this format before. Ignoring all the useless text, we get -147114000000-0700, still leaving me puzzled.
The -147114000000 value is a unix timestamp in milliseconds: it represents the number of milliseconds since unix epoch (which is 1970-01-01T00:00Z or January 1st 1970 at midnight in UTC).
As the number -147114000000 is negative, it represents a date before epoch. In this case, 1965-05-04T07:00:00Z (or May 4th 1965 at 7 AM in UTC).
-0700 is an UTC offset: it represents the difference from UTC. In this case, 7 hours behind UTC, which results in 1965-05-04T00:00-07:00 (or May 4th 1965 at midnight in -07:00 offset). Note that an offset can be written as -07:00, -0700 or -07.
But keep in mind that this same value can represent a different date and time in each timezone. For example, in Pacific/Honolulu timezone (that uses the -10:00 offset since 1947), the same timestamp corresponds to 1965-05-03T21:00-10:00 (May 3rd 1965 at 9 PM, in offset -10:00). So the corresponding date and time will depend on what timezone you convert this to.
That being said, probably the purpose of having the offset is just to tell you what's the offset that the date/time refers to, so it prevents you from converting to a different offset (where you can get different values for local date and time).
Just reminding that -0700 is not a timezone, it's just an offset. Actually, a timezone is the set of all offsets that a region had, has and will have during its history, while the offset is just the difference from UTC (check the section TimeZone != Offset in the timezone tag description). There can be more than one timezone that uses the same offset, so you can't really say in what timezone this is in.

ApI blueprint Date format

I have problem understanding the following date formate from apiblueprint tutorial
2016-02-05T08:40:51.620Z
I now 2016 is the year 02 is the month 05 is the date and 08:40:51 is the time but I dont understand the last part .620Z.
Can some one explain it for me. I wanted to find out AM or PM of the time using javascript from the date using javascript and not sure whether the formate is 12 or 24 hours.
Thanks
First of all, API Blueprint doesn't require you to use any particular Date format; you are free to use whatever you want to.
The format used in the tutorial is the standard ISO 8601 format: .620 is the number of miliseconds, and Z designates a Zulu timezone, meaning UTC.

How to store Indian date and Time in MongoDB ? and How to query using Time fileds(HH:MM:SS)

What is the best way to store indian date and time in mongodb?
I'm going to upload bill details in mongodb. So i've to capture the Bill time which is printed in Bill. This will be in the format like '2014-12-22 14:10:25'. ISODate is good solution? How to covert above date value into ISODate format? Is there any default fuction avilable in mongodb?
How to query the documents based on time elements.For example hourly wise document search.
Please advice
that is possible through JavaScript's Date objec, that supports the ISO date format, so as long as you have access to the date string, you can do something like this:
> doo = new Date("2012-07-14T01:00:00+01:00")
Sat, 14 Jul 2012 00:00:00 GMT
> doo.toTimeString()
'17:00:00 GMT-0700 (MST)'
If you want the time string without the seconds and the time zone then you can call the getHours() and getMinutes() methods on the Date object and format the time yourself.
if any problem please comment me..)

Matlab - Timestamps create a new colum without minutes and without repetitive dates

I have a question about timestamps hope you can help me.
I'm reading one timestamp column from excel to matlab using;
[temp, timestamps] = xlsread('2012_15min.xls', 'JAN', 'A25:A2999');
This column have date like this:
01-01-2012 00:00
01-01-2012 00:15
01-01-2012 00:30
01-01-2012 00:45
01-01-2012 01:00
(it goes on until the end of January in periods of 15 minutes)
Now I want to get a new column in matlab that keeps only year month day and hour, this data must be separated and I don't want to keep repetitive dates (e.g I don't want to get 4 dates with 01 01 2012 0 only one of that)
So I want to get:
01 01 2012 0
01 01 2012 1
01 01 2012 2
It must go until the end of January with periods of 1 hour.
If you know that there is data for every hour you could construct this directly, but if you have possible missing data and you therefore need to convert from your timestamps, then some combination of datestr/datenum/datevec is usually the best bet.
First, convert timestamps with datevec:
times = datevec(timestamps); % sometimes need to also use format string
Then, take only the year/month/day/hour, removing repetitions:
[times_hours,m,n] = unique(times(:,1:4), 'rows');
You can use the indices in m to extract the matching data for those times.
If you want this converted back to some sort of string you can use datestr and specify format:
timesout = datestr(times_hours,'dd mm yyyy hh');