http://qs321.pair.com?node_id=1071830


in reply to Re: Calender billing_prt
in thread Calender billing_prt

#!/usr/local/bin/perl @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); @weekDays = qw(Sun Mon Tue Wed Thu Fri Sat Sun); ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek +, $dayOfYear, $daylightSavings) = localtime(); $year = 1900 + $yearOffset; $theTime = "$hour:$minute:$second, $weekDays[$dayOfWeek] $months[$mont +h] $dayOfMonth, $year"; print $theTime;

this the above code im using it to capture system pc time, i wasnt able to use this time as actually im working on Staf automation. So im writing this perl script so that i can capture the time and use it in my xml code which is required for the billing. I will use this PC time and later generate bill accordingly which i wasnt able to do.(if i subscribed to a plan on say today 24th, he should be billed next month 21st). But my client requirement is that they require the billing according to postpaid customers.

Replies are listed 'Best First'.
Re^3: Calender billing_prt
by thezip (Vicar) on Jan 23, 2014 at 22:25 UTC

    ... and you're wanting to know how to do *what* ?

    Perhaps sprintf() might be your friend:

    my @parts = localtime(time); my $now = sprintf('%04d-%02d-%02d %02d:%02d:%02d', $parts[5]+1900, $parts[4]+1, $parts[3], $parts[2], $parts[1], $parts[0]); print "The current date/time is $now.\n";

    *My* tenacity goes to eleven...
      i was asking how to call the system PC time that i have written in perl script and use it in the xml code .

        I'm sure your XML code is a wonder to behold, but until you show it to us, it doesn't exist, and we can't help you with your date/time problem...


        *My* tenacity goes to eleven...