Erlang – universaltime

Erlang universaltime

In this guide, we will discuss Erlang universaltime. Returns the current date and time according to Universal Time Coordinated (UTC), also called GMT, in the form {{Year, Month, Day}, {Hour, Minute, Second}} if supported by the underlying operating system.

Syntax

universaltime()

Parameters

  • None

Return Value

Returns the current date and time according to Universal Time Coordinated (UTC), also called GMT, in the form {{Year, Month, Day}, {Hour, Minute, Second}} if supported by the underlying operating system.

For example

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~p~n",[erlang:universaltime()]).

Output

When we run the above program we will get the following result. Depending on the system, the output will differ.

{{2016,4,17},{11,51,39}}

Next Topic : Click Here

This Post Has 2 Comments

Leave a Reply