# Only dates, no time

Hi everybody,
TLDR: Is there a way to extract the date and leave out the time?

I am making personal programs for people where they can score points on a daily base for 12 weeks. The first day is ‘Day 1’ and it ends on Day 84. I calculated the day number with:

Yes, I now know my mistake. I thought Extract date extracted the date ( leaving out the time) and it worked…until the end of the month.
How can I cleanly calculate this Day value?

Hi @SenorPelota - for each User, how are you storing their daily points (I’m inferring that each User will have 84 daily score entries). If you know which days have a score already, you can calculate the offset for calculating Day (you need to store the Start Day though and use that instead of Current Date/time). Hope I’m understanding your design intent.

Back up: WHAT are you trying to do?

You think you need to extract “date”. BUT “extract date” is not what you think it is. All that does is give you this… For a date object that represents 08/12/2018, “date” is the “DAY NUMBER”:

12

This is not what you want. (BTW, “month” is the 08 part, “year” is the “2018” part, “day” is an index representing the day of the week.)

What you seek to do, I think, if find “What day is 83 (perhaps 84?) days from the Created Date?”

That starting moment of that date object is:

Created Date:+days 83 set (all time values) to 0

@nikolai everyday has an entry. The user gets to see what his result is for Day 1, Day 2 etc.
As everybody starts the program when they want to, I use the creation date of a first blank entry as the startpoint of the program: Day 1.

@keith I noticed my error. The formula worked untill the beginning of the new month.
What I want to do is calculate the day 83 and then show it. That can easily be done if I can just request the date and calculate with that, basically shaving of the time component.

Created Date:+days 83 set (all time values) to 0

I am not familiar with “set to” ( couldn’t find it in the Bubble reference), how does it work?

A final thought. Users will not login for an unspecified time, but the program continues. Thus, while their last entry might have been on Day 20, it might be the next time they login it actually is Day 23 already.

HI @nikolai & @keithAnyway to help me forward with this?

When I said “set all time components” to 0, I’m just referring to the operators for set hours/minutes/seconds. There are 3 of them. I was just suggesting that the beginning of the day x days from now is (date+x days):00:00:00

That’s all.

Anyway, I don’t understand where you’re still hung up?

Hi Keith,

Yes, I did not realize how to set those to 0. Just did though. With this Formula it worked out:

.

Thanks!

1 Like

Glad you got it sorted! Working with date/time stuff can get pretty confusing… but it gets easier the more you get familiar with it!

Ha, definitely. Sometimes an answer can stare your right in the face… it is these dialogues here that really help get the juices going. Thanks again!

1 Like