![]() ![]() Print "The Formated date and time on the next year at the same time is = $monthday/$month/$year $hours:$minutes:$seconds $weekday\n" #displaying the date and time on the same date and time next year ($seconds,$minutes,$hours,$monthday,$month,$year,$weekday,$yearday,$isdst) = gmtime(time) #calculating the date and time on the same day next year Perl program to obtain the time elapsed since epoch in seconds as the output by making use of time() function and then passing the time elapsed since epoch in seconds as a parameter to the gmtime function to obtain today’s date and time and then display the date and time next year. Then Today’s date and time obtained using the gmtime() function by passing the time elapsed since epoch in seconds as the parameter to the function is displayed as the output on the screen. Then the time elapsed since epoch obtained by using the time() function is passed as a parameter to the gmtime function to obtain today’s date and time. Then we are displaying the time elapsed since the epoch obtained by using the time() function as the output on the screen. In the above program, we are making use of the time() function to obtain the time elapsed since the epoch and storing it in a variable called timeelapsed. Print "Today's date and time obtained using gmtime() function by passing the time elapsed since epoch as the parameter to the function is $todaysdateandtime\n" #Today's date and time obtained using gmtime() function is displayed as the output on the screen ![]() $todaysdateandtime = gmtime( $timeelapsed) #the time elapsed since epoch is passed as a parameter to the gmtime function to obtain today's date and time Print "The time elapsed since the epoch given by the time() function is $timeelapsed\n" #we are displaying the time elapsed since epoch as the output on the screen Perl program to obtain the time elapsed since epoch in seconds as the output by making use of time() function and then passing the time elapsed since epoch in seconds as a parameter to the gmtime function to obtain today’s data and time as the output.Ĭode: #we are making use of time() function to obtain the time elapsed since epoch Given below are the examples of Perl time: Example #1
0 Comments
Leave a Reply. |