Extracting date from datetime

Hello All,

I am trying to extract the date (the full date, not just a day’s date like in the image below; example 17/12/2016) from a list of things.

How will I be able to do that and display it in an RG like below?

1 Like

Use the formatted as option on the display element

Tried that it won’t work! See The problem is I need to pull the unique dates from a list (excluding time). If I use the unique elements option without first extracting the full date then the list will revert a list of unique elements for date & time.

So whatever the formatting is I will face the same problem. If you have any other ideas, then please let me know.

@emmanuel I know that it’s year-end and you guys are planning to party all night :wink: but what’s the possibility of adding an option to extract the full date without the time.

I need this to finalize the project for my company.

Let me know, thanks

If you can live with the list being “text” then you can do the :formatted as first, and then the :unique elements after than and it will pull out the unique dates. That works.

But if you must have the list as “date” … much more complicated.

Even if you create a date list on the User, schedule an API workflow to save the dates, and set hours and minutes to zero … it sort of looks like it works, but it leaves the seconds and milliseconds behind (because you can’t zeroise them). You still can’t do a unique.

Hmm. Then I guess will wait for @emmanuel to have a quick look at this and see if the option of exposing the extractiom of the date is possible .

Indeed.

After a bit of think on my dog walk, you could maybe do it by converting the date into Unix time, divide by 86400, :floor and then multiply by 86400. Create a list of numbers like that on page load via API on a list, and then pull back unique values and convert back to date.

But I think that just shows how in need of date extraction you are :slight_smile:

1 Like

:smile: that’s like reinventing the wheel. But I like the way you think

What is the difference between date and datetime?

Is this one of your Christmas Cracker jokes with a really bad punchline coming :grinning:

2 Likes

No i’m serious. We only have one type of date. So what are we talking about here? Just getting a date with 0:00:00 as a time?

Reading the thread above, from what I can workout is that trying to filter unique dates in a search is difficult, because the date type includes a time component, so if for example the date value is even 1 minute different for the same day, then these are different unique values. So what is trying to be done is be able to search on unique dates e.g. 25th December 2016 without caring about what the time sub-part is.

1 Like

Then you just need to set the hour, minute to 0. I don’t think we need a new feature here.

As Nigel points out:
Even if you create a date list on the User, schedule an API workflow to save the dates, and set hours and minutes to zero … it sort of looks like it works, but it leaves the seconds and milliseconds behind (because you can’t zeroise them). You still can’t do a unique.

So is missing is the ability to change seconds right?

I let @AliFarahat answer, as he is the one trying to solve his problem, doing that may or may not work for him.

However, if it is possible to set the HH and MM, but it leaves the SS with potential values, then yes there should be capability to bring the time completely to 00:00:00

Date/Time is always a pain with data!

Well simply put I need to list unique dates while ignoring all the hours, minutes, seconds…

There is currently an option to extract date, day, year, and so on can we have an additional extract that will extract the complete date without the hours, minutes…?

We added a way to change seconds to 0, that’ll do it. Extracting isn’t the right way here as it would introduce a type change depending on what you pick. Day -> number, Date without hours -> date. that’d be messy.

So what is the best way to list all unique dates in a repeating group?

You asked for a way to extract a date, so you have one:

date: change minutes to 0: change seconds to 0: change hours to 0.

3 Likes

I see what you mean. I will give a try and let you know. Thanks…