2
$\begingroup$

I tried this code:

ubt = WeatherData["Ulaanbaatar", 
  "Temperature" , {{2006, 1, 1, 0, 0}, {2006, 1, 2, 0, 0}}, 
  TimeZone -> +8];

shifted = TimeSeriesShift[ubt, Quantity[8, "Hour"]];
Export["UbShift2.txt", shifted] 

My result is

enter image description here

first colums information is date and time. How to convert this absulute time to local time . For example 2015 6 1 3 0 0. Help me. :)

$\endgroup$
3
$\begingroup$

Use DateList or DateString, depending on desired output:

DateList[3345091200]

(* {2006, 1, 1, 8, 0, 0.} *)


DateString[3345091200]

(* "Sun 1 Jan 2006 08:00:00" *)

Edit: to use this in your specific example, you could do something like this:

Export["UbShift2.txt", Append[DateList[#[[1]]], QuantityMagnitude[#[[2]]]] & /@ shifted["Path"]] 
$\endgroup$
  • $\begingroup$ how remove dot. (* {2006, 1, 1, 8, 0, 0.} *) $\endgroup$ – teegii Apr 19 '15 at 14:23
  • $\begingroup$ I try DateList[{#[[1]], {"Day", "Month", "Year"}}] & /@ shifted. not successfull $\endgroup$ – teegii Apr 19 '15 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.