18.116.36.192 |    

Navigation

Google Advertisement

Die Funktion date() gibt das Aktuelle Datum/Urzeit im Format Dienstag, den 02.02.2010 | 09:36 aus

date
  1. sub date {
  2.  
  3. my @days   = ('Sonntag','Montag','Dienstag','Mittwoch',
  4.                'Donnerstag','Freitag','Samstag');
  5.  
  6. my $time = time() ;
  7. my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($time+($tzone*3600)) ;
  8. $mon = $mon+1 ;
  9.  
  10. $sec  = "0" . $sec 	if ($sec  < 10) ;
  11. $min  = "0" . $min 	if ($min  < 10) ;
  12. $hour = "0" . $hour if ($hour < 10) ;
  13. $mon  = "0" . $mon 	if ($mon  < 10) ;
  14. $mday = "0" . $mday if ($mday < 10) ;
  15.  
  16. $year = 1900+$year ;
  17.  
  18. my $datum = $mday . "." . $mon . "." . $year ;	# 22.11.2002
  19. my $zeit = $hour . ":" . $min ;					# 19:14
  20. return $fulldate = $days[$wday] . ", den " . $datum . " | " . $zeit ;
  21.  
  22. }
Parsed in 0.001 seconds at 497.36 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 3 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)