LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-02-2014, 07:24 PM   #1
apater
LQ Newbie
 
Registered: Feb 2014
Posts: 12

Rep: Reputation: Disabled
File Date earlier then 1965 not possible. Why? Workaround?


For peculiar reasons, I want the filedate on some old scanned image files to have a filedate equal to the date of the original photo. For example, photos of my grandparents from the 40's and 50's. But if I use exiftool to set the filedate equal to DateTimeOriginal, dates before 1965 end up in the future.

1915 shows as 2015, 1964 as 2064, etc

Is there a workaround? And does anyone know how this cutoff date was chosen?
 
Old 06-02-2014, 08:25 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I'm surprised anything earlier than midnight UTC Jan 1, 1970 works - this is the *nix epoch time. Anything before then is "negative time".
 
Old 06-02-2014, 08:45 PM   #3
apater
LQ Newbie
 
Registered: Feb 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
I'd be cool with negative time. Better then future time ...
 
Old 06-02-2014, 09:00 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
The system has no problem with time before 1970. Are you trying to set the file date (as shown by "ls -l") or the EXIF date field within the file? The file date should not be a problem. You can use the touch command to set that:
Code:
$ touch -t 195211291343 /tmp/stamp
$ ls -l /tmp/stamp
-rw-rw-r--. 1 nobody nobody 0 1952-11-29 13:43 /tmp/stamp
The format for the EXIF DateTime field is “YYYY:MM:DD HH:MM:SS”, so there shouldn't be any problem there either if you can just get exiftool to cooperate.
 
1 members found this post helpful.
Old 06-02-2014, 09:16 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Good point - I recall having some issues with using jhead to set dates back in the past (not as far back as the OP tho').
 
Old 06-02-2014, 09:17 PM   #6
apater
LQ Newbie
 
Registered: Feb 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
What I am doing is setting the image DateTimeOriginal to the date that the original photograph was taken, rather the the date it was scanned into a digital image (that date goes in DateTimeDigitized).

And then: exiftool '-filemodifydate<DateTimeOriginal' whatever.jpg

The results: 1952 shows as 2052, etc ...

-rw-r--r-- 1 user user 1119666 Jun 5 2052 1952zwaagstrafamily.jpg
-rw-r--r-- 1 user user 402077 Aug 5 2051 1950wouter&sjorssailing.jpg
-rw-r--r-- 1 user user 451012 May 5 2051 1951mayonboardshiptocanada.jpg
-rw-r--r-- 1 user user 1157442 Apr 5 2051 1951momatgirlscamp.jpg
-rw-r--r-- 1 user user 1081582 May 5 2048 1948mayjanaaltjepater25.jpg
-rw-r--r-- 1 user user 580101 Aug 5 2047 1947wouter&friends.jpg
-rw-r--r-- 1 user user 1115624 Apr 5 2047 1944eastermomsiblings.jpg
-rw-r--r-- 1 user user 471702 Apr 5 2047 1947momschool.jpg
-rw-r--r-- 1 user user 306034 Jun 30 2035 1935wouterpater.jpg
-rw-r--r-- 1 user user 918170 May 5 2015 1915(aprx)aaltjebosma.jpg
-rw-r--r-- 1 user user 978527 Apr 5 2015 1915(aprox)janpater.jpg
-rw-r--r-- 1 user user 1358282 Aug 5 1990 1990august05joyce&nicole.jpg
-rw-r--r-- 1 user user 1135520 Dec 25 1988 1988christmasseattle.jpg
-rw-r--r-- 1 user user 1450650 Jun 28 1988 1990-10-28 20.34.34.jpg
-rw-r--r-- 1 user user 796787 May 5 1988 1988maysean.jpg
-rw-r--r-- 1 user user 1020891 May 5 1988 1988mayhiking.jpg
-rw-r--r-- 1 user user 1114762 Dec 25 1987 1987decembersean.jpg
-rw-r--r-- 1 user user 960499 Oct 25 1987 1987octoberseattlesean.jpg
-rw-r--r-- 1 user user 896565 May 25 1985 1985maymichellejoyce.jpg
-rw-r--r-- 1 user user 894726 Aug 25 1983 1983augustrichardarmy.jpg
-rw-r--r-- 1 user user 718815 Apr 25 1980 1980calvincollegejohn.jpg
-rw-r--r-- 1 user user 883596 Dec 26 1979 1979newskates.jpg
-rw-r--r-- 1 user user 726551 Dec 25 1979 1979christmasskating.jpg
-rw-r--r-- 1 user user 721414 Sep 2 1978 1978blackhillsjoyce.jpg
-rw-r--r-- 1 user user 655919 May 27 1977 1977may27patriciagrad.jpg
-rw-r--r-- 1 user user 961217 May 27 1976 1976joycemanitoba.jpg
-rw-r--r-- 1 user user 888055 May 27 1975 1975winnipegzoo.jpg
-rw-r--r-- 1 user user 994509 Aug 7 1973 1973augustmedicinehatweddingdora&walter.jpg
-rw-r--r-- 1 user user 979255 Nov 7 1971 1971novemberfamilyportrait.jpg
-rw-r--r-- 1 user user 710307 Jun 7 1971 1971dad&kidsfortgarrymanitoba.jpg
-rw-r--r-- 1 user user 776354 Jun 7 1971 1971junemanitoba.jpg
-rw-r--r-- 1 user user 604246 Oct 7 1969 1969octoberjoyce&walterpaterwinnipeg.jpg
-rw-r--r-- 1 user user 499991 Jul 7 1968 1968julycalgary.jpg
-rw-r--r-- 1 user user 663174 May 7 1967 1967alanricharddad.jpg
-rw-r--r-- 1 user user 498151 Apr 7 1967 1968calgaryfather&sons.jpg
-rw-r--r-- 1 user user 539054 Apr 7 1967 1967calgaryjoyce&patricia.jpg
-rw-r--r-- 1 user user 611947 May 7 1966 1966athome.jpg
-rw-r--r-- 1 user user 637789 May 7 1966 1966calgary.jpg
-rw-r--r-- 1 user user 1423333 Oct 28 1965 1965-10-28 20.20.36.jpg
-rw-r--r-- 1 user user 552550 Apr 7 1965 1965aprilrichard.jpg
 
Old 06-02-2014, 09:22 PM   #7
apater
LQ Newbie
 
Registered: Feb 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
exiftool reports: Date/Time Original : 1915:04:05 11:40:00

So that needs to be converted to 19150405114000?
 
Old 06-02-2014, 09:48 PM   #8
apater
LQ Newbie
 
Registered: Feb 2014
Posts: 12

Original Poster
Rep: Reputation: Disabled
touch -t 190505051140 1905.jpg works!

I'll post on the exiftool forum for more tricks to ge things working ...

Cheers!
 
Old 06-03-2014, 08:32 AM   #9
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by apater View Post
exiftool reports: Date/Time Original : 1915:04:05 11:40:00

So that needs to be converted to 19150405114000?
If you want to specify something for seconds, you need a decimal point as a separator:
Code:
touch -t 190505051140.00 1905.jpg
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] why 12/01/1965 is an invalid date ? marozsas Linux - General 1 09-12-2010 08:07 PM
[SOLVED] BASH: Keep original mod date of a file and 'date' it back to same file? SilversleevesX Programming 4 07-16-2010 11:12 AM
[SOLVED] Use date with touch to create new file with date based name craigjl Linux - Newbie 5 03-12-2010 09:46 AM
shell script to find modified date and last accessed date of any file. parasdua Linux - Newbie 6 04-22-2008 09:59 AM
Need workaround for Date Format Cyberdyne Slackware 2 07-22-2005 04:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration