Friday, November 7, 2008

Date Format Pattern

How often we use to format date and times ? I never had a chance put aside this informationthe right way. Maybe for lack of time or lazyness ... but this time I'll do it right once and for all !

So here is the tables with the parameters and description.

The table below displays a list of the standard format characters . The format characters are case-sensitive; for example, 'f' and 'F' represent different patterns.

Format Character

Associated Property/ Description
d ShortDatePattern
D LongDatePattern
f Full Date and time (long Date and short time)
F FullDateTimePattern (long Date and long time)
g General (short Date and short time)
G General (short Date and long time)
m, M MonthDayPattern
r, R RFC1123Pattern
s SortableDateTimePattern (based on ISO 8601) using local time
t ShortTimePattern
T LongTimePattern
u UniversalSortableDateTimePattern using the format for universal time display
U Full date and time (long date and long time) using universal time

The table below shows a list of patterns that can be combined to create custom patterns. The patterns are case-sensitive; for example, "MM" is recognized, but "mm" is not. If the custom pattern contains white-space characters or characters enclosed in single quotation marks, the output string will also contain those characters. Characters not defined as part of a format pattern or as format characters are reproduced literally.


Format Pattern

Description

dd The day of the month. Single-digit days will have a leading zero.
ddd The abbreviated name of the day of the week, as defined in AbbreviatedDayNames.
M The full name of the day of the week, as defined in DayNames.
MM The numeric month. Single-digit months will have a leading zero.
MMM The abbreviated name of the month, as defined in AbbreviatedMonthNames.
MMMM The full name of the month, as defined in MonthNames.
y The year without the century. If the year without the century is less than 10, the year is displayed with no leading zero.
yy The year without the century. If the year without the century is less than 10, the year is displayed with a leading zero.
yyyy The year in four digits, including the century.
gg The period or era. This pattern is ignored if the date to be formatted does not have an associated period or era string.
h The hour in a 12-hour clock. Single-digit hours will not have a leading zero.
hh The hour in a 12-hour clock. Single-digit hours will have a leading zero.
H The hour in a 24-hour clock. Single-digit hours will not have a leading zero.
HH The hour in a 24-hour clock. Single-digit hours will have a leading zero.
m The minute. Single-digit minutes will not have a leading zero.
mm The minute. Single-digit minutes will have a leading zero.
s The second. Single-digit seconds will not have a leading zero.
ss The second. Single-digit seconds will have a leading zero.
t The first character in the AM/PM designator defined in AMDesignator or PMDesignator, if any.
tt The AM/PM designator defined in AMDesignator or PMDesignator, if any.

Sunday, November 2, 2008

Ipod / Iphone 2g offline docs.

Hi as previously announced, I want to share with you the way that I found in order to easily view my word / pdf / excel (all documents recognized by Ipod) offline.

1. In the past ...

This was a lot easier for Jailbreaken Ipod Touch / Iphone 1g. We could install pdf viewer application for instance or even better install local web server apache and resolve within safari the web address 127.0.0.1

1. Nowadays.

As we are aware all included files whithin emails that have been opened in the Ipod / Iphone are automatically cached that means that next time you are offline you will still be able to check those documents.

Starting with this percept, I combined two technology in order to ease my process to upload and view offline content.
  • setup gmail account with the mail application

  • Install the gmail drive shell extension
    this allows you to turn a gmail account into a physical drive in your system . You will be able to upload files and download from anywhere to anywhere. Proceed with the following url :
    Gmail Drive

  • Once the drive in setup you will see the image below. You just need to find the word document and pdf that we want to have available in your ipod and transfer them into the newly added Gmail Drive.


  • Finaly, go back to you Ipod / Iphone open the newly added files to load them into Ipod / Iphone cache system and enjoy anywhere your files withouth worrying about connection !


3. In the future ...

The Jailbreak application for both Ipod and Iphone is almost out. The "iphone-dev team" is amazingly fast to find weakness on the new firmware 2.1 /2.2. It won't be long before we all go to our old ways :-)


Hope this information helped.