date format

By WorldDMT on Jul 27, 2009

usage: $wtime(,,).eng

the parameter N is 1 or 2

-1 format (dd/mm/yyyy) e.g: $ wtime (14-5-84,1) return 14/05/1984
-2 format (dd/mm/yy) e.g: $wtime(14-5-84,2) return 14/05/84

the parameter C is the separator "-","/",".","+" ...
If C isnt specifed the default separator will be "/"

e.g: $wtime(14-5-84,1,-) return 14-05-1984

Property (. eng) replace the day with the month format (month/day/year) e.g: $ wtime (14-5-84,2). eng return 05/14/84

alias wtime {
  if ($istok(1.2,$2,46)) var %x dd|mm|yy $+ $iif($2 == 1,yy)
  if ($prop == eng) var %x $replace(%x,dd,mm,|mm,|dd)
  return $date($ctime($1),$replace(%x,$chr(124),$iif($3,$v1,/)))
}

Comments

Sign in to comment.
_Daniel_   -  Jul 28, 2009

?

 Respond  
eyiezinc   -  Jul 28, 2009

lol..very nice /7

 Respond  
_Daniel_   -  Jul 27, 2009

Very nice!

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.