Results 1 to 1 of 1
  1. #1
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    138

    Smile Unanswered: at all who want to manipulate the date

    Hi users,
    at all who want to manipulate the UNIX-Date backwards or forwards.
    Move the attachment to idate.sc and give x permissions to the file.
    The script idate.sc works from 01.01.1900 since 31.12.2099.

    On commandline insert "idate.sc dd.mm.yyyy" and you get the days since 01.01.1900.

    or "idate.sc 38179" and you get the date 12.07.2004

    !!!!!!!!!!! remember : the dateformat is day.month. year !!!!!!!!!!!!!!!!!
    !!!!!!!!!!! ist halt aus Deutschland !!!!!!!!!!!!!!!!!

    Use this Example :
    ############# Example 1 : 100 days backwards from today
    ################################################## #####
    EXAMPLE=100
    AKT_DATE=`date '+%d.%m.%Y'`
    echo "AKT_DATE from today => "$AKT_DATE
    INF_DATE=`idate.sc $AKT_DATE`
    echo "Days since 01.01.1900 => "$INF_DATE
    NEW_DATE=`expr $INF_DATE - $EXAMPLE`
    NEW_DATE=`idate.sc $NEW_DATE`
    echo "NEW_DATE "$EXAMPLE" days backwards from today => "$NEW_DATE
    echo "."
    echo "-------------------------------------------------"
    echo "."
    ############# Example 2 : 100 days forwards from today
    ################################################## #####
    EXAMPLE=100
    AKT_DATE=`date '+%d.%m.%Y'`
    echo "AKT_DATE from today => "$AKT_DATE
    INF_DATE=`idate.sc $AKT_DATE`
    echo "Days since 01.01.1900 => "$INF_DATE
    NEW_DATE=`expr $INF_DATE + $EXAMPLE`
    NEW_DATE=`idate.sc $NEW_DATE`
    echo "NEW_DATE "$EXAMPLE" days forwards from today => "$NEW_DATE
    Attached Files Attached Files
    Last edited by fla5do; 07-12-04 at 17:27.
    Greetings from germany
    Peter F.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •