# Current Date returns in varying (user's device) format \> messed up filename for PDF

**URL:** <https://community.glideapps.com/t/current-date-returns-in-varying-users-device-format-messed-up-filename-for-pdf/70092>\
**Category:** Report a Bug\
**Tags:** pdf\
**Created:** [January 26, 2024, 9:03pm UTC](https://community.glideapps.com/t/current-date-returns-in-varying-users-device-format-messed-up-filename-for-pdf/70092 "2024-01-26T21:03:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkirkwood001](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jkirkwood001/32/54952_2.png) [@jkirkwood001](https://community.glideapps.com/u/jkirkwood001)\
**Post date:** [January 26, 2024, 9:03pm UTC](https://community.glideapps.com/t/current-date-returns-in-varying-users-device-format-messed-up-filename-for-pdf/70092/1 "2024-01-26T21:03:57Z")

</div>

I’m not sure if this is a bug, but it messed up an operation generating PDFs with DocsAutomator.

In select cases, the filename I’m generating would not produce a valid PDF filename using DocsAutomator. The failed records created the pdf but it did not append a “.pdf” extension, so they wouldn’t open automatically. It turns out that some of my records had dashes and datestamp with “p.m.” in it failed (the ones underlined in red):

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/4/b4f6af4dd05fcd76a34f883dc725b1a082b20f3a.png)

I’m going to try and format the datastamp before including it in my filname template:

Created new CurrentDateTime MATH field in fixed format:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/f/8fdc449db3845aec787f90a7cfb2746bf9555c79.png)

Updated filename template:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/0/700969808842604c50d42436e3d38e63ce393f06.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 26, 2024, 9:18pm UTC](https://community.glideapps.com/t/current-date-returns-in-varying-users-device-format-messed-up-filename-for-pdf/70092/2 "2024-01-26T21:18:48Z")

</div>

Dates are formatted based on the user’s device settings. Dates in the US are usually formatted differently from the rest of the world, and other countries have other differences as well. Lots of variables at play.

It’s best to convert dates to a stable number for use cases like this where you are using dates for more than just display purposes.

```auto
Year(Date)*10^10
+ Month(Date)*10^8
+ Day(Date)*10^6
+ Hour(Date)*10^4
+ Minute(Date)*10^2
+ Second(Date)

```

---

<div class="post-metadata">

**Author:** ![jkirkwood001](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jkirkwood001/32/54952_2.png) [@jkirkwood001](https://community.glideapps.com/u/jkirkwood001)\
**Post date:** [January 26, 2024, 10:27pm UTC](https://community.glideapps.com/t/current-date-returns-in-varying-users-device-format-messed-up-filename-for-pdf/70092/3 "2024-01-26T22:27:06Z")

</div>

Thanks Jeff.

I’m aware of the different global date formats. So I can’t use Glide’s fixed formatting as shown in the screen shot. That will ALSO vary by region?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [January 26, 2024, 10:57pm UTC](https://community.glideapps.com/t/current-date-returns-in-varying-users-device-format-messed-up-filename-for-pdf/70092/4 "2024-01-26T22:57:36Z")

</div>

The date formatting set inside a Date or Math column can vary by region settings. It’s not as “fixed” as you may think. It will display differently based on the user’s device settings, so you don’t exactly have control over that date format other than long, medium, or short and with or without time. Also consider that different devices, such as Android, iOS, Windows, MacOS, Linux, as well as different browsers may render that date slightly differently.

It’s like that so your app can be used globally and will adapt based on a user’s region.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [July 24, 2024, 10:57pm UTC](https://community.glideapps.com/t/current-date-returns-in-varying-users-device-format-messed-up-filename-for-pdf/70092/5 "2024-07-24T22:57:39Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
