Information - TimeSpan Display Formula & Function

When you need an information to display the timespan between 2 dates. See the scenario below:

Prepare 3 Informations:

  • EndDate (Type: Date / DateTime)
  • StartDate (Type: Date / DateTime)
  • TimeSpan (Type: Text)

Create an text information used to store the TimeSpan value.

Here’s the format structure of TimeSpan:

dd:hh:mm:ss:ff

  • “dd” => Days
  • “hh” => Hours (0 ~ 23)
  • “mm” => Minutes (0 ~ 60)
  • “ss” => Seconds (0 ~ 60)
  • “ff” => Miliseconds (0 ~ 999)

Assume we have a timespan value like this:’ 10:14:53:14:236’. Base on this value, we can know:

  • 10 => 10 days
  • 14 => 14 hours
  • 53 => 53 minutes
  • 14 => 14 seconds
  • 236 = 236 miliseconds


Display Format of TimeSpan
Use ToString() to display timespan value with format

ToString("dd\.hh\:mm\:ss\:ff")

You may also adjust the format inside, here’s the sample below:

  • Day only => ToString("dd")
  • Hours & minutes => ToString("hh\:mm")

In Practice:
information > Formula



Input of Form:


Output in Form:
image



Specialized Display
Various of TimeSpan display function

  • TotalDays (Display total of days)
  • TotalHours (Display total of hours)
  • TotalMinutes (Display total of minutes)
  • TotalSeconds (Display total of seconds)
  • TotalMilliseconds (Display total of milliseconds)


TotalDays
Used to represent the total days of the current instance in the TimeSpan structure

([TimeSpan Value]).TotalDays

In Practice:
information > Formula
image

Input of Form:



Output in Form:
image



TotalHours
Used to represent the total hours of the current instance in the TimeSpan structure

([TimeSpan Value]).TotalHours

In Practice:
information > Formula
image

Input of Form:



Output in Form:
image



TotalMinutes
Used to represent the total minutes of the current instance in the TimeSpan structure

([TimeSpan Value]).TotalMinutes

In Practice:
information > Formula
image

Input of Form:



Output in Form:
image



TotalSeconds
Used to represent the total seconds of the current instance in the TimeSpan structure

([TimeSpan Value]).TotalSeconds

In Practice:
information > Formula
image

Input of Form:



Output in Form:
image



TotalMilliseconds
Used to represent the total milliseconds of the current instance in the TimeSpan structure

([TimeSpan Value]).TotalMilliseconds

In Practice:
information > Formula
image

Input of Form:



Output in Form:
image



Display as TimeSpan
Create a new integer/number type information and set in form used to input number.
eg:
image

Function of number display as TimeSpan format

  • TimeSpan.FromDays() (Display number as day in TimeSpan format)
  • TimeSpan.FromHours() (Display number as hour in TimeSpan format)
  • TimeSpan.FromMinutes() (Display number as minute in TimeSpan format)
  • TimeSpan.FromSeconds() (Display number as second in TimeSpan format)
  • TimeSpan.FromMilliseconds() (Display number as millisecond in TimeSpan format)


TimeSpan.FromDays()
Returns a TimeSpan that represents a specified number of days

TimeSpan.FromDays([Number in Timespan])

In Practice:
information > Formula
image

Input of Form:
image

Output in Form:
image



TimeSpan.FromHours()
Returns a TimeSpan that represents a specified number of hours

TimeSpan.FromHours([Number in Timespan])

In Practice:
information > Formula
image

Input of Form:
image

Output in Form:
image



TimeSpan.FromMinutes()
Returns a TimeSpan that represents a specified number of minutes

TimeSpan.FromMinutes([Number in Timespan])

In Practice:
information > Formula
image

Input of Form:
image

Output in Form:
image



TimeSpan.FromSeconds()
Returns a TimeSpan that represents a specified number of seconds

TimeSpan.FromSeconds([Number in Timespan])

In Practice:
information > Formula
image

Input of Form:
image

Output in Form:
image



TimeSpan.FromMilliseconds()
Returns a TimeSpan that represents a specified number of milliseconds

TimeSpan.FromMilliseconds([Number in Timespan])

In Practice:
information > Formula
image

Input of Form:
image

Output in Form:
image