# Timestamps and conversion

**URL:** <https://community.thunkable.com/t/timestamps-and-conversion/391969>\
**Category:** Questions about Thunkable X\
**Created:** [January 4, 2020, 11:29pm UTC](https://community.thunkable.com/t/timestamps-and-conversion/391969 "2020-01-04T23:29:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rem708](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@rem708](https://community.thunkable.com/u/rem708)\
**Post date:** [January 4, 2020, 11:29pm UTC](https://community.thunkable.com/t/timestamps-and-conversion/391969/1 "2020-01-04T23:29:13Z")

</div>

Time is a very import function in programming. Its used a lot in databases records.  
At first I could not find any way of producing these until I stumbled upon DEVICE and the block seconds since 1970 i.e. Unix time - perfect.  
However, I’ve not yet found a way to convert these timestamps back to a human readable form.

Does anyone know if there is a way (I’d rather not call an external API)

Thought I would enquire before I make a request for enhancement

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [January 5, 2020, 12:07pm UTC](https://community.thunkable.com/t/timestamps-and-conversion/391969/2 "2020-01-05T12:07:30Z")

</div>

If you look at the blocks from this category, you will see that there are other blocks for working with dates and time.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 5, 2020, 3:03pm UTC](https://community.thunkable.com/t/timestamps-and-conversion/391969/3 "2020-01-05T15:03:20Z")

</div>

Like @actech stated there are blocks to grab current

Month, day of month, day of week, hour, minute, second, and year

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/5/f521cef7d65c46bb6bd219670b08ce77cae9da5c.jpeg)

---

<div class="post-metadata">

**Author:** ![rem708](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@rem708](https://community.thunkable.com/u/rem708)\
**Post date:** [January 5, 2020, 9:59pm UTC](https://community.thunkable.com/t/timestamps-and-conversion/391969/4 "2020-01-05T21:59:33Z")

</div>

Thanks, actech and jgibb20189

I can use these to create a timestamp in human readable form and in my current app will use as there appears to be no other option.  
I’m from the old school and storing a character string like that is bad practice. A unix time, as given in the “time since 1970”, is a much better solution. Firstly its a much smaller entity to store and as its often already native and therefore faster for the cpu to process. What’s more its easier to sort records with a number.  
Ugly as it is, I’m going to store both the human readable string and the Unix time. That way I can sort on the unix time and not have to write a very ugly procedure to be able sort on the character string.

I believe this product would benefit from much better time handling which should not be a difficult X platform process.  
Hold the press!

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/f/cf89508b63780ea156a541439cfe4db5846b1fca.png)

The above I put together (sure it might be further refined) to produce a 8 character string which can be sorted upon. It could be further enhanced to include hour and second. Its easy to carve up back into a more normal date representation.

Note the Join is need to convert the numeric to a text string

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [January 6, 2020, 1:59pm UTC](https://community.thunkable.com/t/timestamps-and-conversion/391969/5 "2020-01-06T13:59:56Z")

</div>

If you need fast and reliable operation of Thunkable X, do not use app-variable blocks.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 6, 2020, 2:14pm UTC](https://community.thunkable.com/t/timestamps-and-conversion/391969/6 "2020-01-06T14:14:26Z")

</div>

would you suggesting using the “stored” or “cloud” variable instead?

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [January 6, 2020, 2:18pm UTC](https://community.thunkable.com/t/timestamps-and-conversion/391969/7 "2020-01-06T14:18:54Z")

</div>

I suggest using variables from the function parameter and components that can be used to transfer data between screens (if necessary)

---

<div class="post-metadata">

**Author:** ![flashag](https://avatars.discourse-cdn.com/v4/letter/f/4bbf92/32.png) [@flashag](https://community.thunkable.com/u/flashag)\
**Post date:** [April 17, 2021, 10:00am UTC](https://community.thunkable.com/t/timestamps-and-conversion/391969/8 "2021-04-17T10:00:38Z")

</div>

Hi @actech ! I just found the comment accidentally and I think this is very important. Could you please show by example what you mean or point out some posts if you already did.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:46am UTC](https://community.thunkable.com/t/timestamps-and-conversion/391969/9 "2024-11-08T11:46:09Z")

</div>


