Comment faire une soustraction de date?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Comment faire une soustraction de date?
# 1  
Old 08-25-2006
Comment faire une soustraction de date?

Bonjour,

Comment faire une soustraction de dates en shell ??????

Smilie

j'ai 2 dates de la forme : DD/MM/YYYY HH:MM/SS

que j'aimerais soustraire, existe-t-il un format julian qui permette d'effectuer la soustraction ? ou bien faut il décomposer la date en DD, MM, YYYY etc, et soustraire chacune des unités ????

Quelqu'un peut-il m'aider ????

Merci
Smilie
# 2  
Old 08-25-2006
Bonjour,

This forum is an English on, so all your questions need to be in English... read the rules. See these threads:

Ce forum est en anglais, toutes les questions doivent être en anglais...lis les règles. Consultes ces réponses:

https://www.unix.com/showthread.php?t...highlight=date
https://www.unix.com/showthread.php?t...highlight=date
https://www.unix.com/showthread.php?t...highlight=date
# 3  
Old 08-25-2006
How to make a substraction of dates

Sorry, sorry

So, I write my question again :

How can I manage to substract 2 dates with a script shell ?

The date format is :
DD/MM/YYYY HH(24):MI:SS


Is there a simple solution or should I write a complicated function ?

Thank you for your help
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Date: invalid date trying to set Linux date in specific format

i try to set linux date & time in specific format but it keep giving me error Example : date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" or date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" keep giving me this error : date: invalid date ‘19-01-2017 00:05:01' Please use CODE tags... (7 Replies)
Discussion started by: umen
7 Replies

2. Shell Programming and Scripting

Help about comment verification

Hello, I have a file, in which line 40 is commented. It is basically a cron job, #05,35,50 * * * * /usr/local/scripts/my.sh how i can i verify the line 40 is commented, if not then give me message not commented, otherwise provide us message it is commented. (5 Replies)
Discussion started by: learnbash
5 Replies

3. Shell Programming and Scripting

Shell - Compléter automatiquement une fenêtre

Bonjour tout le monde! Voila, dans le cadre de mon travail j'aurais besoin de savoir si c'est possible (si oui, comment), en Shell, de remplir automatiquement ce genre de fenêtres (cf: screenshot) avec des variables prédéfinies.... (0 Replies)
Discussion started by: devilsnake88
0 Replies

4. Shell Programming and Scripting

Converting a date to friday date and finding Min/Max date

Dear all, I have 2 questions. I have a file with many rows which has date of the format YYYYMMDD. 1. I need to change the date to that weeks friday date(Ex: 20120716(monday) to 20120720). Satuday/Sunday has to be changed to next week friday date too. 2. After converting the date to... (10 Replies)
Discussion started by: 2001.arun
10 Replies

5. Shell Programming and Scripting

How can i comment out a section between two particular lines

I want to find out which files under /etc have the the following section: and then i would like to comment out the above section in all the files. Please help. (3 Replies)
Discussion started by: proactiveaditya
3 Replies

6. Shell Programming and Scripting

Comment a line with SED

I have around 25 hosts and each hosts has 4 instance of jboss and 4 different ip attached to it . I need to make some changes to the startup scripts. Any tips appreciated. I have total of 100 instances which bind to 100 different ip address based on instance name. For example File1 ... (1 Reply)
Discussion started by: gubbu
1 Replies

7. UNIX for Dummies Questions & Answers

comment lines

Is there a command to put a comment (#) in a whole part of a shell script? (5 Replies)
Discussion started by: vero_81
5 Replies

8. Shell Programming and Scripting

Pls comment on my script.

Hi guys, hope you scripting gurus here can help me out, the logic in my script somehow not working the way it should, this script part of a bigger backup script suppose to do some checking on the cluster prior to bringing up the package on MC/SG after backend cloning operation, this portion is... (3 Replies)
Discussion started by: sparcguy
3 Replies

9. Shell Programming and Scripting

How to copy and comment out

I need help with a script. Here's what I want to do. I have a file "upsrk.txt" which can be either under "/home/upsrk" OR "/home/oracle" On some systems file "upsrk.txt" may not exist, in that case I want to just exit out of the script. If the file is there, I want to check if I have the... (3 Replies)
Discussion started by: upsrk
3 Replies

10. UNIX for Dummies Questions & Answers

# comment

Hi guys and Gals AIX 5.1 If I had a # above several scripts would it comment out everything below it? Like this # 01 2 ** ..................................... 02 31 ......................................... # this is a script 03 12 **.......................... Would... (6 Replies)
Discussion started by: rocker40
6 Replies
Login or Register to Ask a Question