# MiniExifTool date formats

**URL:** <https://www.ruby-forum.com/t/miniexiftool-date-formats/107263>\
**Category:** Ruby\
**Created:** [June 19, 2007, 8:47pm UTC](https://www.ruby-forum.com/t/miniexiftool-date-formats/107263 "2007-06-19T20:47:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mtnbiker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@mtnbiker](https://www.ruby-forum.com/u/mtnbiker)\
**Post date:** [June 19, 2007, 8:47pm UTC](https://www.ruby-forum.com/t/miniexiftool-date-formats/107263/1 "2007-06-19T20:47:20Z")

</div>

I’m getting

Sat Jun 09 23:10:57 -0700 2007

as output from

photo.DateTimeOriginal

I’d like to avoid parsing it myself and should think I’d be able to get  
an easier to deal with format. I’m going to change it to 2006.10.14  
after shifting the time from the camera’s UTC to the local date.

So a YYYYMMDD format would be easy to deal with. I suspect that the  
format I’m seeing has to do with using it on my OS X system. (I’m  
guessing that the -0700 is the GMT offset, but this is my computer  
offset. My camera doesn’t know what time zone it is set to. That’s a  
clue to me that my OS is affecting the output.)

Thanks for any help. And thanks again Jan for putting MiniExifTool  
together.

---

<div class="post-metadata">

**Author:** ![mtnbiker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@mtnbiker](https://www.ruby-forum.com/u/mtnbiker)\
**Post date:** [June 19, 2007, 9:11pm UTC](https://www.ruby-forum.com/t/miniexiftool-date-formats/107263/2 "2007-06-19T21:11:22Z")

</div>

It worked! Posting that is. Posting a question engaged the correct part  
of my brain.

Time.xmlschema is close enough. I am wondering if there aren’t more  
extensive conversions as in PHP using mktime to convert formats.

---

<div class="post-metadata">

**Author:** ![mtnbiker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@mtnbiker](https://www.ruby-forum.com/u/mtnbiker)\
**Post date:** [June 19, 2007, 9:15pm UTC](https://www.ruby-forum.com/t/miniexiftool-date-formats/107263/3 "2007-06-19T21:15:11Z")

</div>

12 34 wrote:

> It worked! Posting that is. Posting a question engaged the correct part  
> of my brain.
> 
> Time.xmlschema is close enough. I am wondering if there aren’t more  
> extensive conversions as in PHP using mktime to convert formats.

Worked again. Found strtime.

Too bad we can’t revise or delete in this forum.
