# \#datetime

**URL:** https://discourse.julialang.org/tag/datetime/1418.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Makie Axis xticks: passing (datetimes, labels) fails with MethodError](https://discourse.julialang.org/t/makie-axis-xticks-passing-datetimes-labels-fails-with-methoderror/134411)

<div class="topic-metadata">

**Author:** [@lfenzo](https://discourse.julialang.org/u/lfenzo)\
**Replies:** 4\
**Last updated:** [December 8, 2025, 12:02pm UTC](https://discourse.julialang.org/t/makie-axis-xticks-passing-datetimes-labels-fails-with-methoderror/134411 "2025-12-08T12:02:26Z")

</div>

Hello! I’m trying to change the DateTime xtick label intervals in my Makie plot by manually passing the xticks parameter to Axis as a tuple with two vectors: (datetimes, labels). According to the current xticks docs: T…

---

## [Find decimal year from time](https://discourse.julialang.org/t/find-decimal-year-from-time/126670)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 7\
**Last updated:** [March 11, 2025, 9:15am UTC](https://discourse.julialang.org/t/find-decimal-year-from-time/126670 "2025-03-11T09:15:45Z")

</div>

Hi, I’ve searched for something in libraries like Dates and AstroTime, but maybe missed it as I’m surprised not to find it. I would like to find the decimal time from a date, hour, minute, second, e.g.: DateTime(2018,…

---

## [Time range with reversed bounds](https://discourse.julialang.org/t/time-range-with-reversed-bounds/129693)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 5\
**Last updated:** [June 6, 2025, 4:51pm UTC](https://discourse.julialang.org/t/time-range-with-reversed-bounds/129693 "2025-06-06T16:51:12Z")

</div>

Hi, I have: using Dates lower\_bound = Dates.Time(23,59,00) upper\_bound = Dates.Time(00,01,00) I do: julia\> collect(upper\_bound:Dates.Minute(1):lower\_bound) 1439-element Vector{Time}: 00:01:00 00:02:00 00:03:00 ⋮ …

---

## [Create a new DateTime dataframe column from Date and Time columns](https://discourse.julialang.org/t/create-a-new-datetime-dataframe-column-from-date-and-time-columns/129406)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 2\
**Last updated:** [May 28, 2025, 1:02pm UTC](https://discourse.julialang.org/t/create-a-new-datetime-dataframe-column-from-date-and-time-columns/129406 "2025-05-28T13:02:21Z")

</div>

Hi, (sorry for the pedantic syntax…) using DataFrames using Dates df = DataFrame(DATE=\[Date("2025-01-01","yyyy-mm-dd"), Date("2025-01-01","yyyy-mm-dd"), Date("2025-01-02","yyyy-mm-dd")\], TIME=\[Time("00:00:00"), Time("…

---

## [Cannot convert Time to Time](https://discourse.julialang.org/t/cannot-convert-time-to-time/129207)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 3\
**Last updated:** [May 21, 2025, 10:23am UTC](https://discourse.julialang.org/t/cannot-convert-time-to-time/129207 "2025-05-21T10:23:26Z")

</div>

Any idea what\`s happening? julia\> s = "18:59:00" "18:59:00" julia\> t0 = Time(s) 18:59:00 julia\> t = Time(t0) ERROR: MethodError: no method matching Int64(::Time) The type \`Int64\` exists, but no method is defined for t…

---

## [Comparing Javascript Temporal with Julia](https://discourse.julialang.org/t/comparing-javascript-temporal-with-julia/125419)

<div class="topic-metadata">

**Author:** [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Replies:** 0\
**Last updated:** [January 31, 2025, 7:37am UTC](https://discourse.julialang.org/t/comparing-javascript-temporal-with-julia/125419 "2025-01-31T07:37:22Z")

</div>

An article about Javascript’s upcoming Temporal API for working with dates and times is trending on Hacker News today. I was curious how it compared with Julia, so I used a small Pluto notebook to test things out and wri…

---

## [Parsing corporate DateTime format with calendar week](https://discourse.julialang.org/t/parsing-corporate-datetime-format-with-calendar-week/124725)

<div class="topic-metadata">

**Author:** [@dobby](https://discourse.julialang.org/u/dobby)\
**Replies:** 5\
**Last updated:** [January 14, 2025, 5:45pm UTC](https://discourse.julialang.org/t/parsing-corporate-datetime-format-with-calendar-week/124725 "2025-01-14T17:45:40Z")

</div>

Hi all, I have date time data in the following format: 2434.5 14:20 Which is for: year 2024, 34th week of the year (August), 5th day of the week (Friday), 14:20 o’clock. I am struggeling to parse the calendar week an…

---

## [Retrieve current timezone](https://discourse.julialang.org/t/retrieve-current-timezone/122763)

<div class="topic-metadata">

**Author:** [@hhaensel](https://discourse.julialang.org/u/hhaensel)\
**Replies:** 6\
**Last updated:** [November 18, 2024, 11:41am UTC](https://discourse.julialang.org/t/retrieve-current-timezone/122763 "2024-11-18T11:41:36Z")

</div>

I am missing two things in Dates/TimeZones convert a unix timestamp into the computer’s local time determine the system’s timezone Maybe I missed something? For 1) I have found a solution, which could go into Dates a…

---

## [How to format or print a difference in two DateTime objects](https://discourse.julialang.org/t/how-to-format-or-print-a-difference-in-two-datetime-objects/121638)

<div class="topic-metadata">

**Author:** [@anon91151494](https://discourse.julialang.org/u/anon91151494)\
**Replies:** 7\
**Last updated:** [October 23, 2024, 2:09pm UTC](https://discourse.julialang.org/t/how-to-format-or-print-a-difference-in-two-datetime-objects/121638 "2024-10-23T14:09:48Z")

</div>

I want to print the following object, which is a difference between two DateTimes datetime\_diff = datetime2 - datetime1 The type of datetime\_diff appears to be Milliseconds. That means it can be printed, but produces t…

---

## [NanoDates.jl has reached version 1](https://discourse.julialang.org/t/nanodates-jl-has-reached-version-1/118130)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 0\
**Last updated:** [August 13, 2024, 11:18am UTC](https://discourse.julialang.org/t/nanodates-jl-has-reached-version-1/118130 "2024-08-13T11:18:40Z")

</div>

All NanoDates.jl posted issues have been resolved, all known bugs have been quashed, and I feel good about its state.

---

## [Cast/parse multiple variables at once](https://discourse.julialang.org/t/cast-parse-multiple-variables-at-once/114345)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 5\
**Last updated:** [May 17, 2024, 8:42am UTC](https://discourse.julialang.org/t/cast-parse-multiple-variables-at-once/114345 "2024-05-17T08:42:27Z")

</div>

Hi, Having to process dates read from files, I’m currently doing e.g.: date="20240516235400" yyyy, mm, dd, h, m, s = parse(Int32, date\[1:4\]), parse(Int32, date\[5:6\]), parse(Int32, date\[7:8\]), parse(Int32, date\[9:10\]), …

---

## [Tuple to DateTime](https://discourse.julialang.org/t/tuple-to-datetime/114066)

<div class="topic-metadata">

**Author:** [@DTL](https://discourse.julialang.org/u/DTL)\
**Replies:** 4\
**Last updated:** [May 10, 2024, 6:27am UTC](https://discourse.julialang.org/t/tuple-to-datetime/114066 "2024-05-10T06:27:50Z")

</div>

I’m processing a CSV file where I have a couple of years of recordings, there are several readings per hour, and I’m summing them altogether to get a total per day. I get the data into a dataframe ok. julia\> df 32047×…

---

## [Comparing times in a dataframe](https://discourse.julialang.org/t/comparing-times-in-a-dataframe/112131)

<div class="topic-metadata">

**Author:** [@Marc\_Sevaux](https://discourse.julialang.org/u/Marc_Sevaux)\
**Replies:** 2\
**Last updated:** [March 26, 2024, 11:31am UTC](https://discourse.julialang.org/t/comparing-times-in-a-dataframe/112131 "2024-03-26T11:31:22Z")

</div>

Dear all, I am not very comfortable with time formats. I have the following dataframe. ┌─────────┬──────────┐ │ id\_site │ hour │ │ String7 │ Time │ ├─────────┼──────────┤ │ BAN4 │ 08:48:00 │ │ BAN4 │ 08:5…

---

## [How to improve code to compute the mean of values grouped by DateTime?](https://discourse.julialang.org/t/how-to-improve-code-to-compute-the-mean-of-values-grouped-by-datetime/106235)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 7\
**Last updated:** [November 15, 2023, 11:27pm UTC](https://discourse.julialang.org/t/how-to-improve-code-to-compute-the-mean-of-values-grouped-by-datetime/106235 "2023-11-15T23:27:37Z")

</div>

I have written the piece of code below. It takes a vector of DateTime, a vector of Float64, and an integer g as input to calculate the mean of the the type Float64 by grouped DateTime type given time granularity g. In t…

---

## [DateTime Curiosity: Dates.epochms2datetime](https://discourse.julialang.org/t/datetime-curiosity-dates-epochms2datetime/104205)

<div class="topic-metadata">

**Author:** [@g-gundam](https://discourse.julialang.org/u/g-gundam)\
**Replies:** 5\
**Last updated:** [September 25, 2023, 8:45am UTC](https://discourse.julialang.org/t/datetime-curiosity-dates-epochms2datetime/104205 "2023-09-25T08:45:08Z")

</div>

I’m new to Julia but not new to programming, and I’m wondering why Dates.epochms2datetime returned a negative value. using Dates unix\_0 = unix2datetime(0) # 1970-01-01T00:00:00 # So far, so good. Dates.value(unix\_0) #…

---

## [Difference between two dates in Julia](https://discourse.julialang.org/t/difference-between-two-dates-in-julia/103048)

<div class="topic-metadata">

**Author:** [@Sandy45](https://discourse.julialang.org/u/Sandy45)\
**Replies:** 8\
**Last updated:** [August 28, 2023, 11:12pm UTC](https://discourse.julialang.org/t/difference-between-two-dates-in-julia/103048 "2023-08-28T23:12:47Z")

</div>

I am trying to get difference between two dates in number of “days”. I am able to substract the two date fields but results is being produced as “n days”. As we can see below DATE\_DIFF is produced after executing below…

---

## [\`DateTime\` arithmetic on \`Microsecond\` (or smaller) scale](https://discourse.julialang.org/t/datetime-arithmetic-on-microsecond-or-smaller-scale/102949)

<div class="topic-metadata">

**Author:** [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Replies:** 99\
**Last updated:** [August 26, 2023, 6:15pm UTC](https://discourse.julialang.org/t/datetime-arithmetic-on-microsecond-or-smaller-scale/102949 "2023-08-26T18:15:46Z")

</div>

There is currently a PR on the repo with very lively discussion about what the following operation should do: using Dates a = now() b = a + Nanosecond(1) (the situation is analogous with Microsecond) Currently, the …

---

## [XLSX parsing DateTime](https://discourse.julialang.org/t/xlsx-parsing-datetime/103071)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 2\
**Last updated:** [August 22, 2023, 4:35pm UTC](https://discourse.julialang.org/t/xlsx-parsing-datetime/103071 "2023-08-22T16:35:38Z")

</div>

I am loading data from an Excel file that includes DateTime data. The DateTime string, when the time is 0:00 is parsed as a Date instead of a DateTime. An example of the data being loaded is: Date a 2023-07-11 0:00 45…

---

## [Read datetime with timezone offset from csv](https://discourse.julialang.org/t/read-datetime-with-timezone-offset-from-csv/102738)

<div class="topic-metadata">

**Author:** [@vtomar](https://discourse.julialang.org/u/vtomar)\
**Replies:** 1\
**Last updated:** [August 11, 2023, 11:46pm UTC](https://discourse.julialang.org/t/read-datetime-with-timezone-offset-from-csv/102738 "2023-08-11T23:46:13Z")

</div>

I have a csv file that contains datetime column where datetime contains timezone offset. for example: 2019-01-11 17:35:00+00:00 How do I correctly specify the datetime format. I am currently specifying the format below…
