Skip to main content
July 11, 2007
Question

Date Format By Country

  • July 11, 2007
  • 1 reply
  • 308 views
Hi There Helpful people...

Usual stuff first DW8, (Mac - not that that makes a difference), ASP VB connected to SQL database.

I have a content management - which is used to maintain the content of an international site. On the site we have a timeline displaying key moments in the company's history. The articles are translated into the relevant languages and are pasted in to the database - no problems here. The dates are entered numerically ie 01/01/2007. The SQL statement for the page converts this date into Month and Year (ie October 1983) using the statement "SELECT datename (mm,hi_date) 'Month', datename (yy,hi_date) 'Year', hi_text, hi_image" A later statement selects which language to pull from the database as all 6 languages go in the same database but are given a country code (GB, ES, PT etc).

My problem is this - that month and year always displays in English no mater which country it is view in. Is there a way of getting it to show the month in the language of the user or simpler still specify the language I want for the date directly in the page? (Each language is done as a sub-site, ie www.websitename.com/es so it does not need to be a one for all solution)

Your help would be appreciated

Best Regards

Stuart
This topic has been closed for replies.

1 reply

Inspiring
July 11, 2007
Well, the database server is always the same language. You could set the
LCID of the page based on the selected language, though. Then, pass the
date as a date from the database and use VBScript's date functions to
display the month and year. Those functions will obey the LCID setting of
the page.

<%=MonthName(Month(yourRS.Fields.Item("dateCol").Value))%>


"kaostheory777" <webforumsuser@macromedia.com> wrote in message
news:f72gon$804$1@forums.macromedia.com...
> Hi There Helpful people...
>
> Usual stuff first DW8, (Mac - not that that makes a difference), ASP VB
> connected to SQL database.
>
> I have a content management - which is used to maintain the content of an
> international site. On the site we have a timeline displaying key moments
> in
> the company's history. The articles are translated into the relevant
> languages
> and are pasted in to the database - no problems here. The dates are
> entered
> numerically ie 01/01/2007. The SQL statement for the page converts this
> date
> into Month and Year (ie October 1983) using the statement "SELECT datename
> (mm,hi_date) 'Month', datename (yy,hi_date) 'Year', hi_text, hi_image" A
> later
> statement selects which language to pull from the database as all 6
> languages
> go in the same database but are given a country code (GB, ES, PT etc).
>
> My problem is this - that month and year always displays in English no
> mater
> which country it is view in. Is there a way of getting it to show the
> month in
> the language of the user or simpler still specify the language I want for
> the
> date directly in the page? (Each language is done as a sub-site, ie
> www.websitename.com/es so it does not need to be a one for all solution)
>
> Your help would be appreciated
>
> Best Regards
>
> Stuart
>