Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

current year bash

date +"%Y"
date +"%y"
 
## Store to a shell variable ##
mydate=$(date +'%Y')
myyear=`date +'%Y'`
echo "Year = $mydate"
echo "Year = $myyear"
Source by www.cyberciti.biz #
 
PREVIOUS NEXT
Tagged: #current #year #bash
ADD COMMENT
Topic
Name
9+1 =