UTC to local time or local time to UTC Conversion [message #94547] |
Thu, 29 June 2017 15:35  |
siumtesfai
Messages: 62 Registered: April 2013
|
Member |
|
|
Hello
I have two dataset with UTC time and local time.
I want to make consistent time format. Change both to local time or Utc time format.
Example local time format (-yyyy-mm-dd hr:min:sec)
-2008-05-15 14:14:28 -2008-05-15 14:14:43 -2008-05-15 14:14:58 -2008-05-15 14:15:13 -2008-05-15 14:15:28
-2008-05-15 14:15:43 -2008-05-15 14:15:58 -2008-05-15 14:16:13 -2008-05-15 14:16:28 -2008-05-15 14:17:14
-2008-05-15 14:17:29 -2008-05-15 14:17:44 -2008-05-15 14:17:59 -2008-05-15 14:18:14 -2008-05-15 14:18:29
-2008-05-15 14:18:44 -2008-05-15 14:18:59 -2008-05-15 14:19:14 -2008-05-15 14:19:29 -2008-05-15 14:19:44
If I used Eastern day time saving , local time = UTC - 4hr
Best regards
Sium
|
|
|
Re: UTC to local time or local time to UTC Conversion [message #94549 is a reply to message #94547] |
Fri, 30 June 2017 07:57  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
I would look at the IDL routines for converting between UTC numeric values and ISO-8601 strings
https://www.harrisgeospatial.com/docs/timestamptovalues.html
https://www.harrisgeospatial.com/docs/timestamp.html
Your strings are not in the ISO-8601 standard but they are very close to it. I think the following commands converts them to ISO-8601
IDL> a = ['-2008-05-15 14:14:28', '-2008-05-15 14:14:43', '-2008-05-15 14:14:58', '-2008-05-15 14:15:13', '-2008-05-15 14:15:28']
IDL> strput,a,'T',11
IDL> a = strmid(a,1)
--Wayne
On Thursday, June 29, 2017 at 6:35:53 PM UTC-4, Sium T wrote:
> Hello
>
> I have two dataset with UTC time and local time.
>
> I want to make consistent time format. Change both to local time or Utc time format.
>
> Example local time format (-yyyy-mm-dd hr:min:sec)
>
> -2008-05-15 14:14:28 -2008-05-15 14:14:43 -2008-05-15 14:14:58 -2008-05-15 14:15:13 -2008-05-15 14:15:28
> -2008-05-15 14:15:43 -2008-05-15 14:15:58 -2008-05-15 14:16:13 -2008-05-15 14:16:28 -2008-05-15 14:17:14
> -2008-05-15 14:17:29 -2008-05-15 14:17:44 -2008-05-15 14:17:59 -2008-05-15 14:18:14 -2008-05-15 14:18:29
> -2008-05-15 14:18:44 -2008-05-15 14:18:59 -2008-05-15 14:19:14 -2008-05-15 14:19:29 -2008-05-15 14:19:44
>
> If I used Eastern day time saving , local time = UTC - 4hr
>
>
> Best regards
>
> Sium
|
|
|