I want to use the countdown timer to to countdown from a date the user enters with the date / time picker.
For example - User selects a date that is 2 weeks from now. The countdown timer would show on their page 14 days, 0 hours, 0 minutes, 0 seconds and countdown from there.
Also, if they come back tomorrow it will still show the correct countdown time.
To avoid the continuous getting calculated date time, when user go to that specific screen, current time can be saved and calculated, but this will remove the real time updates.
But you can calculate based on current time directly and show in real time, but this will consume both connection and performance in users device.
Datepicker by itself doesn’t have any functionality. Treat it like a “selector”. So what you can do:
add a numeric property to some collection (e.g. MySeconds)
add a button. For this button, add an “Update” action to update MySeconds. The value should be taken from DatePicker and multiplied by 86400.
the result you get will be number of seconds from 01/01/1970, 12:00 AM, GMT+0.
I am not sure why would you need it though If you would like to have a number of seconds between now and some date in future, then you need to update this numeric property with something like “(value from datepicker - current time) * 86400”.
Maybe you will need it to do in 2 steps: first put the values of Current Time and Datepicker’s into 2 additional datetime properties, and then use the values from these properties to calculate the difference. But in my opinion one-step should work.
I can’t imagine what you could be doing wrong - I have just created the same setup and it works for me perfectly (no need for 2 step, same formula).
Is “Seconds” a Numeric property?
Are you 100% sure the user is logged-in? If you get to this screen with non-logged-in user then this property won’t be changed.