[TxMt] Re: Date format conversion bundle?

Kai Vermehr k at eboy.com
Fri Mar 26 20:06:33 UTC 2010


Thanks a lot! I don't want to take advantage of you, but if you had the
time, how would you convert number formatting from 1.234,56 to 1,234.56 with
regex and tmcommand?

Thanks again!


On Fri, Mar 26, 2010 at 11:21 AM, Hans-Jörg Bibiko <bibiko at eva.mpg.de>wrote:

>
> 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
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
>



-- 
Kai Vermehr
eBoy Arts Inc.
5658 Westhaven Road
West Vancouver BC
V7W 1T8 Canada
mobile +1 (778) 822 4498
k at eboy.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20100326/32488843/attachment.html>


More information about the textmate mailing list