SOLVED
Hours to datetime
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
DADE
7 - Meteor
‎05-21-2020
10:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
I have 8760 rows per year and I would like to convert them to datetimeformat in Alteryx (taking into account daylight savings time). Is there any way to do this?
hour of the year | year | What I want |
1 | 2020 | 2020-01-01 00:00:00 |
2 | 2020 | 2020-01-01 01:00:00 |
3 | 2020 | 2020-01-01 02:00:00 |
4 | 2020 | 2020-01-01 03:00:00 |
5 | 2020 | 2020-01-01 04:00:00 |
6 | 2020 | 2020-01-01 05:00:00 |
7 | 2020 | 2020-01-01 06:00:00 |
8 | 2020 | 2020-01-01 07:00:00 |
9 | 2020 | 2020-01-01 08:00:00 |
10 | 2020 | 2020-01-01 09:00:00 |
11 | 2020 | 2020-01-01 10:00:00 |
12 | 2020 | 2020-01-01 11:00:00 |
13 | 2020 | 2020-01-01 12:00:00 |
14 | 2020 | 2020-01-01 13:00:00 |
15 | 2020 | 2020-01-01 14:00:00 |
16 | 2020 | 2020-01-01 15:00:00 |
17 | 2020 | 2020-01-01 16:00:00 |
18 | 2020 | 2020-01-01 17:00:00 |
19 | 2020 | 2020-01-01 18:00:00 |
20 | 2020 | 2020-01-01 19:00:00 |
21 | 2020 | 2020-01-01 20:00:00 |
22 | 2020 | 2020-01-01 21:00:00 |
23 | 2020 | 2020-01-01 22:00:00 |
24 | 2020 | 2020-01-01 23:00:00 |
25 | 2020 | 2020-01-02 00:00:00 |
26 | 2020 | 2020-01-02 01:00:00 |
27 | 2020 | 2020-01-02 02:00:00 |
... | 2020 | ... |
8760 | 2020 | 2020-12-31 23:00:00 |
Solved! Go to Solution.
Labels:
- Labels:
- Date Time
1 REPLY 1
Hannah_Lissaman
11 - Bolide
‎05-21-2020
10:39 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @DADE
This is a perfect use for the Generate Rows tool. You can use this to generate all hours in a year from scratch.
For the daylight savings part of your request, you will need to add the start and end times of daylight savings as an input. You can then use a Formula tool with an if statement to check whether a date falls within the period, and add 1 hour if it does.
I have attached my workflow for you.
