# Time stamp on jpg

**URL:** <https://www.ruby-forum.com/t/time-stamp-on-jpg/118055>\
**Category:** Ruby\
**Created:** [October 23, 2007, 4:45pm UTC](https://www.ruby-forum.com/t/time-stamp-on-jpg/118055 "2007-10-23T16:45:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f9ae1b/32.png) [@nick](https://www.ruby-forum.com/u/nick)\
**Post date:** [October 23, 2007, 4:45pm UTC](https://www.ruby-forum.com/t/time-stamp-on-jpg/118055/1 "2007-10-23T16:45:43Z")

</div>

I am trying to find the time that a jpg was created. I am using the  
File.atime(file) code. My problem is it will tell me the date that it  
was created but the time is 00:00:00, I was wanting to know if anyone  
else has ever came across this problem. I am using ruby 1.86  
Thanks  
Nick

---

<div class="post-metadata">

**Author:** ![nick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f9ae1b/32.png) [@nick](https://www.ruby-forum.com/u/nick)\
**Post date:** [October 23, 2007, 4:54pm UTC](https://www.ruby-forum.com/t/time-stamp-on-jpg/118055/2 "2007-10-23T16:54:52Z")

</div>

nick wrote:

> I am trying to find the time that a jpg was created. I am using the  
> File.atime(file) code. My problem is it will tell me the date that it  
> was created but the time is 00:00:00, I was wanting to know if anyone  
> else has ever came across this problem. I am using ruby 1.86  
> Thanks  
> Nick

try mtime  
atime is the time last accessed, not created

---

<div class="post-metadata">

**Author:** ![nick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f9ae1b/32.png) [@nick](https://www.ruby-forum.com/u/nick)\
**Post date:** [October 23, 2007, 5:48pm UTC](https://www.ruby-forum.com/t/time-stamp-on-jpg/118055/3 "2007-10-23T17:48:57Z")

</div>

On Tue, Oct 23, 2007, Citizen S. wrote:

> nick wrote:
> 
> > I am trying to find the time that a jpg was created. I am using the  
> > File.atime(file) code. My problem is it will tell me the date that it  
> > was created but the time is 00:00:00, I was wanting to know if anyone  
> > else has ever came across this problem. I am using ruby 1.86
> 
> try mtime  
> atime is the time last accessed, not created

Depending on where the JPEG came from, you might try extracting the EXIF  
data too. If the image is coming from a camera, it’s very likely to  
have a timestamp for when it was captured.

Search Rubyforge for ‘exif’, there are a number of projects.

Ben

---

<div class="post-metadata">

**Author:** ![nick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/f9ae1b/32.png) [@nick](https://www.ruby-forum.com/u/nick)\
**Post date:** [October 23, 2007, 6:01pm UTC](https://www.ruby-forum.com/t/time-stamp-on-jpg/118055/4 "2007-10-23T18:01:48Z")

</div>

On Oct 23, 9:54 am, Citizen S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> –  
> Posted viahttp://www.ruby-forum.com/.

thanks
