Get Current Time Only

This process will get the Current Time and format it accordingly.

DateTime.Current DateTimeFormat:DateTime.DateTimeFormat.DateAndTime \
                    Offset:'0' \
                    CurrentDateTime=> CurrentDateTime

Text.FromDateTime DateTime: CurrentDateTime  \
                StandardFormat:Text.WellKnownDateTimeFormat.ShortDate \
                Result=> FormattedDateTime

Display.ShowMessage Title:'' \
                    Message:'The time right now is '+FormattedDateTime \
                    Icon:Display.Icon.Information \
                    Buttons:Display.Buttons.OK \
                    DefaultButton:Display.DefaultButton.Button1 \
                    IsTopMost:False \
                    ButtonPressed=> ButtonPressed

In more detail:


The process will retrieve the current date and time, convert the DateTime value to text and display it.

Step 1: Retrieve the Date and Time

Get the current date and time, by using the “DateTime.Current” action.

DateTime.Current DateTimeFormat:DateTime.DateTimeFormat.DateAndTime \
                    Offset:'0' \
                    CurrentDateTime=> CurrentDateTime

Step 2: Convert the DateTime Value to Text

Convert the DateTime value of the previous action to text.

Text.FromDateTime DateTime: CurrentDateTime  \
                StandardFormat:Text.WellKnownDateTimeFormat.ShortDate \
                Result=> FormattedDateTime

Use the“Text.DateTimeToText”action:

  1. Set the “DateTime” argument to “CurrentDateTime”, which is the output variable of the previous action.
  2. Change the name of the output variable “Result” to “FormattedDateTime”.

Step 3: Display the DateTime Value

Display the current date and time.

Display.ShowMessage Title:'' \
                    Message:'The time right now is '+FormattedDateTime \
                    Icon:Display.Icon.Information \
                    Buttons:Display.Buttons.OK \
                    DefaultButton:Display.DefaultButton.Button1 \
                    IsTopMost:False \
                    ButtonPressed=> ButtonPressed

Use the “Display.ShowMessage” action and set the “message” argument to “ ‘The time right now is’+ FormattedDateTime ”. The FormattedDateTime is the output variable of the previous action.