# Seconds since 1970 to yyyy-mm-dd

**URL:** <https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603>\
**Category:** Questions about Thunkable X\
**Created:** [February 19, 2022, 6:53pm UTC](https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603 "2022-02-19T18:53:43Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![maptheunknown](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@maptheunknown](https://community.thunkable.com/u/maptheunknown)\
**Post date:** [February 19, 2022, 6:53pm UTC](https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603/1 "2022-02-19T18:53:43Z")

</div>

Can anyone share a project or logic on how to convert Seconds since 1970 to a date format (yyyy-mm-dd)?

Thanks in advance!

---

<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:** [February 19, 2022, 7:05pm UTC](https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603/2 "2022-02-19T19:05:46Z")

</div>

> [@Fun Share: Fun with Date Formatting](https://community.thunkable.com/t/fun-share-fun-with-date-formatting/1681696):
>
> This project shows different ways of working with time/timestamps using the web viewer. Keep your time in seconds (as it really should be) and format it for the user only when needed! AND format in your preferred way! ON THE FLY! [https://x.thunkable.com/projectPage/61e8895b1943bc0010bf7b86](https://x.thunkable.com/projectPage/61e8895b1943bc0010bf7b86) It allows you to use any formatting string available here Skys the limit! The basic idea here is to pass “seconds since 1970” values and a format to the webviewer and to receive back a formatted version o…

---

<div class="post-metadata">

**Author:** ![maptheunknown](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@maptheunknown](https://community.thunkable.com/u/maptheunknown)\
**Post date:** [February 19, 2022, 7:46pm UTC](https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603/3 "2022-02-19T19:46:33Z")

</div>

Thanks!! I’ll check this out!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [February 20, 2022, 10:13am UTC](https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603/4 "2022-02-20T10:13:10Z")

</div>

Check this out  
[https://x.thunkable.com/projectPage/61cd0bd6237278001093b960](https://x.thunkable.com/projectPage/61cd0bd6237278001093b960)  
done in Thunkable blocks without any calls to external code.

Credit goes to @manyone

This is another version. all using blocks  
[https://x.thunkable.com/projectPage/617d60166771f90011dd10ea](https://x.thunkable.com/projectPage/617d60166771f90011dd10ea)

---

<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:** [February 20, 2022, 1:42pm UTC](https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603/5 "2022-02-20T13:42:12Z")

</div>

oof 😅 . so many blocks to only get back year/month/date. I recently put in a feature request for date blocks. Hopefully sometime this year we can replace both of our solutions with Thunkable Blocks that do this transformation for us _and_ into any format we want.

@muneer & @manyone thank you for sharing these solutions. I had no clue how to do these maths before! Very cool!

@maptheunknown IDK if i shared or made public the HTML files i use in that project. if not, i’ll put them up in my github account and link to it sometime this week!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [February 20, 2022, 2:23pm UTC](https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603/6 "2022-02-20T14:23:07Z")

</div>

> [@jared](#):
>
> oof 😅 . so many blocks to only get back year/month/date.

Yes, I agree. When I was developing with **AppGyver** , it was much easier. The platform has a **JavaScript** block that you can pass any text as a JS function and you will get the result. Very easy and not _very heavily loaded_ like the `Web Viewer`.

I really wish such a simple block will be available so that we get rid of the unnecessary heavy use of the `Web Viewer` and it can solve many other issues not only the data conversion.

In the other hand, to covert the `seconds since 1970` you just need to multiply it by 1000 and pass it to a JS function that simple says

```auto
return new Date([Your parameter]).toString();

```

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [February 20, 2022, 4:37pm UTC](https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603/7 "2022-02-20T16:37:12Z")

</div>

I was thinking that recently, too. I’d like to avoid the web viewer when just needing JavaScript. And example of this would be swipe detection without needing the canvas or keyboard entry detection without a text input component.

---

<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:** [February 20, 2022, 4:45pm UTC](https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603/8 "2022-02-20T16:45:44Z")

</div>

> [@tatiang](#):
>
> swipe detection

Would love ❤ this as a component event. It would’ve really made my most recent app submission the bees knees

> [@muneer](#):
>
> s a **JavaScript** block

Would really heart ❤ love this ^^^^^^

---

<div class="post-metadata">

**Author:** ![maptheunknown](https://avatars.discourse-cdn.com/v4/letter/m/f475e1/32.png) [@maptheunknown](https://community.thunkable.com/u/maptheunknown)\
**Post date:** [February 23, 2022, 5:27pm UTC](https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603/9 "2022-02-23T17:27:44Z")

</div>

Thanks for all the responses! very helpful! I’ll try this out!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [May 24, 2022, 5:28pm UTC](https://community.thunkable.com/t/seconds-since-1970-to-yyyy-mm-dd/1743603/10 "2022-05-24T17:28:08Z")

</div>

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