# Question of time

Hi
I would like to create a custom time picker
I would like to know : the fact to change the hour and convert it in milliseconds i have to create a custom time picker witch depends on the date too ?
Thanks for your attention

See example of custom number picker, the principle would be the same:

Use the clock Timer date/millis blocks to do your conversions

Hi

Thanks for your answer.
May i repeat my problem ?
In a label i have picked an hour in milliseconds formated this way hh:mm
if i have change the hour to 14h today is not the same if i change time to 14h towmorrow, right ?
its not the same time in milliseconds from 1970
i have to makeinstant from date and time ?

Regards

Do you want to pick a date/time then add time to it to get a new date/time or do you just want to pick a date/time ?

hi

i want to pick time hoping the new time depends of the day i do the correction eventually because i calculate duration between time

my problem is convert a time in milliseconds from 1970 whatever the day

regards

Not sure I fully understand. let us start with the basics:

You will see that the date and time pickers return only partial information, whilst clock1.now returns a full set. The time picker returns only time from the start of the epoch, the date picker returns no time information.

Seems you will want to work with a full instant in order to do what you want ?

hi

your examples are clear besides i use the last one to calculate duration between times
i think it's me who is not clear in fact i don't really want date picker
i could find on the forum how to calculate duration so that's right
if i press a button to get clock now it works
my concern is how to convert a time from a label in milliseconds (i know calculate durations)
my label content was 10:45 and i change it to 12:25
12:25 is not the same amont of milliseconds for today, or tomorrow isnt'it ?

regards

I believe you will need to play around with the clock blocks to find what you want. Below I create an instant to show the time, then the millis of that full instant

a big thank you !

as you said i have to play around for the second block works with any date
or perhaps i can use two buttons to forward or rewind time (the amount of milliseconds stocked in a variable) and a label to check the date since it's only format with that : Long press button

regards