1833325 Members
3066 Online
110051 Solutions
New Discussion

Date Manipulation

 
SOLVED
Go to solution
Fuad_1
Regular Advisor

Date Manipulation

Hi,

How I can subtract minutes from the current time value and assign the result to a variable?

Thanks.
Set goals, and work to achieve them
4 REPLIES 4
twang
Honored Contributor

Re: Date Manipulation

# date +%X | awk -F: '{x=$2 - } {print x}'
twang
Honored Contributor
Solution

Re: Date Manipulation

more..
assignment the result to variable:
# Y=$(date +%X | awk -F: '{x=$2-10} {print x}'); echo $Y
Fuad_1
Regular Advisor

Re: Date Manipulation

Tnaks, it is working.
Set goals, and work to achieve them
Fuad_1
Regular Advisor

Re: Date Manipulation

Thanks.
Set goals, and work to achieve them