Skip to content

Instantly share code, notes, and snippets.

@ueliwechsler
Created July 5, 2018 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ueliwechsler/37bae2fe83344e35c55f1a887e47eda3 to your computer and use it in GitHub Desktop.
Save ueliwechsler/37bae2fe83344e35c55f1a887e47eda3 to your computer and use it in GitHub Desktop.
Shows some ways, how to work with DateTime format in Julia. #Julia #DateTime #time, #Dates
year, month, day = Dates.yearmonthday(now(Dates.UTC)); hour = Dates.Hour(now(Dates.UTC))
timeNow = DateTime(year,month,day,hour)
utc_start = [timeNow:Dates.Hour(1):timeNow+Dates.Hour(n-1)...]
timeNow = now(Dates.UTC)
utc_start = [Dates.format(value, "yyyy-m-dd HH:00:00") for value in timeNow:Dates.Hour(1):timeNow+Dates.Hour(n-1)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment