I suppose you should be able to use all the formatting rules given by Nathan’s link.
You may also want to have a look here for general number formatting (currencies, scientific notation etc.):
I’m not sure to understand what you mean by this:
You can construct all the date and time you want by using Construct Date and Time of the ‘Math’ panel.
The format component is really powerful!
You can really quickly assemble inputs and generate precisely formatted output strings.
You can also make it culture sensitive (note the differences: $/€ for currency and ‘.’/‘,’ as decimal separator):
In the code I posted, the date/time is updated each time the button is pressed. The same will happen with any component output replacing the button, so for example, when a lengthy process completes the date/time can be recorded.
This is different than the standard Construct Date and Construct Time components, and your “now” example, which are static values based on when the file is opened or the components are placed on the canvas. They don’t change after that.
I noticed that the ‘C’ (Culture) input to Format can be changed by right-clicking it and choosing from various options.
The ‘now’ panel coupled to the Time object does not seem to be static. Every time the solution is recomputed (by hitting F5) or re-opened, the output value gets updated.
One kind of dirty workaround that can be used to mimic an update with a button, could be to use a Pick’n’Choose component and plug the ‘now’ into both inputs. Each time the button is pressed, the output gets refreshed:
I see what you’re saying but… The purple group below is an arbitrary block of “slow code”. Changing the Value List(blue group) or the slider will trigger a “slow” re-compute that updates the time in the white group but has no effect on the “now” time in the cyan group. That’s what I mean by static.
You’re skills are getting so high mate, and you are such a great help to so many people out there. thanks.
Is there difficulty in adding days / hours / minutes / seconds, due to the base 60 Sexagesimal time of the minutes and seconds, base 24 of hours, and variance of base calendar days - 30,31, leap years and so forth?
I tried looking into the system.datetime and system.datetimeoffset:
Computer languages have been dealing with date/time and interval issues for decades. Languages that I’m familiar with like Java, Javascript, PHP (and to some extent Python) have similar standard methods. I suggest you do some more reading:
Python is pretty easy. Double-click the Python component in what I posted above, then explore what the datetime class has to offer. No harm in experimenting.
import datetime
now = datetime.datetime.now()
Y = now.year
M = now.month
D = now.day
h = now.hour
m = now.minute
s = now.second