ProtoFlux:UTC Now: Difference between revisions

From Resonite Wiki
Created page with "{{#Invoke:ProtoFlux|GenerateUI |Name=Utc Now |Category=Time |Outputs= [ {"Name": "*", "Type":"DateTime"} ] |}} Returns the current time in UTC[https://en.wikipedia.org/wiki/Coordinated_Universal_Time]. Each evaluation triggers an individual call to DateTime.UtcNow[https://learn.microsoft.com/en-us/dotnet/api/system.datetime.utcnow]. This means that within a single Impulse it can be evaluated with different values. This can be used to measure the runtime o..."
 
Fixed many links.
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:
|}}
|}}


Returns the current time in UTC[https://en.wikipedia.org/wiki/Coordinated_Universal_Time].
Returns the current time in [https://en.wikipedia.org/wiki/Coordinated_Universal_Time UTC].


Each evaluation triggers an individual call to DateTime.UtcNow[https://learn.microsoft.com/en-us/dotnet/api/system.datetime.utcnow].
Each evaluation triggers an individual call to [https://learn.microsoft.com/en-us/dotnet/api/system.datetime.utcnow DateTime.UtcNow].
This means that within a single [[Impulses|Impulse]] it can be evaluated with different values.
This means that within a single [[Impulses|Impulse]] it can be evaluated with different values.


Line 16: Line 16:


Since UTC is independent of the local user's timezone it should return approximately the same value on every user.
Since UTC is independent of the local user's timezone it should return approximately the same value on every user.
{{Note|Utc Now is still dependent on the local computer's clock. Differences between users in minutes are somewhat common and in case of incorrectly setup clocks they can reach hours easily. Use [[World Time Float]] or [[World Time Double]] for a more consistent time source.|warning}}
{{Note|Utc Now is still dependent on the local computer's clock. Differences between users in minutes are somewhat common and in case of incorrectly setup clocks they can reach hours easily. Use [[ProtoFlux:World Time Float|World Time Float]] or [[ProtoFlux:World Time Double|World Time Double]] for a more consistent time source.|warning}}


== Outputs ==  
== Outputs ==  

Latest revision as of 03:19, 20 May 2024

Utc Now
*
Time

Returns the current time in UTC.

Each evaluation triggers an individual call to DateTime.UtcNow. This means that within a single Impulse it can be evaluated with different values.

This can be used to measure the runtime of impulse based ProtoFlux to sub-millisecond precision.

Since UTC is independent of the local user's timezone it should return approximately the same value on every user.

Utc Now is still dependent on the local computer's clock. Differences between users in minutes are somewhat common and in case of incorrectly setup clocks they can reach hours easily. Use World Time Float or World Time Double for a more consistent time source.

Outputs

* (DateTime)

The current time in UTC

Examples