In the above program, we can see we have first imported a Perl module for date and time as “use DateTime” so that we can use locatime() inbuilt function of Perl. Print "The current day name and month name is: " Print = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec = qw(Sun Mon Tue Wed Thu Fri Sat Sun) Print "The localtime() function to display particular format of date and time" Print "The date and time of the system of the timezone which is used is :" Print "The use of localtime() function without any arguments " Print "Demonstration of localtime() function in Perl" Then the second syntax can display only those time elements which are specified as expression (expr) in the syntax as seen in the above syntax section. In the above syntax, both can be used where the first one displays the set of time elements having 9 different elements defining the time of time zone. In this, we can write expr anything which can display result related to time elements only. In this, if there is no argument passed, then the localtime() function returns the current date and time of the timezone. Now let us see syntax and examples of localtime() function: In Perl, to display date and time that has analyzed time of the current time zone which is done by converting the given expression of time into a set of time elements which is an array of time elements and contains at least 9 element in this array which includes the time and date of the current time zone such as second, minute, hour, day, month, year, day of the week, day of the year, isdst. Web development, programming languages, Software testing & others In Perl, date and time codes usually need a Perl module known as the DateTime module, which contains various combinations of representation of date and time where this module uses a New Style calendar, which is known as a geographic calendar. In this article, we will see the Perl time function known as localtime(), which is defined as a function for returning the time elements related to the date and time of the system or program. ![]() Working of localtime() Function in Perl with Examples In general, the localtime() function is defined as a function for returning the elements list containing the elements such as seconds, hours, minutes, etc., which are usually 9 elements in the list that are returned by this localtime() function to display information related to date and time of the system and this function does not take any argument as a compulsion. In Perl, localtime is defined as a time function which displays the date and time for the local time zones that usually converts a specified time into a certain list of time elements which are numerical data types for all the elements in the list returned by this localtime() function in Perl.
0 Comments
Leave a Reply. |