Welcome to openkapow Sign in | Join
.

[How to?] Convert month or day to 2 digits ("09" instead of "9")

  •  10-22-2007, 4:17 AM

    [How to?] Convert month or day to 2 digits ("09" instead of "9")

    At some stage, I extract some text with Action>Extract and Converters>Advanced extract. My extract result is like this:
    $1 is a day of the month
    $2 is a month

    I want to generate a date like "10-22". So my output expression is $2-$1.
    But this gives

    10-8
    10-9
    10-10
    10-11
    ...

    In fact, I prefer to format all numbers to 2 digits, something like:
    10-08
    10-09
    10-10
    10-11
    ...
    What operator can I use to turn all extracted numbers to 2 digits?

    In Expression > Function, there is a "Convert year to 4 digits", but what I need is "Convert month / day to 2 digits" or a generic function that can do this. Can someone help?
View Complete Thread
.
Copyright 2006, 2007 KapowTech.com All Rights Reserved Company | Contact | Terms | Privacy