[TxMt] Re: Date format conversion bundle?

Hans-Jörg Bibiko bibiko at eva.mpg.de
Fri Mar 26 18:21:32 UTC 2010


On Mar 26, 2010, at 6:53 PM, Rob McBroom wrote:

> On Mar 26, 2010, at 1:39 PM, c6y wrote:
> 
>> Hi, does anyone know of a date format conversion bundle? I need to change
>> dates from  31.12.2009 to 2009-12-31
> 
> I don’t know of one, but you could make a command pretty quickly using PHP. I suggest PHP because of its awesome `strtotime` function.
> 
> http://us.php.net/manual/en/function.strtotime.php

or via various regular expressions

eg
create a tmcommand with input selection and this script:

perl -pe 's/([0-3]?\d)\.([01]?\d)\.(\d{2,4})/$3-$2-$1/'

or similar

--Hans


More information about the textmate mailing list