CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 UK date format : how to?

Print topic Send  topic

Author Message
guest
Posted: 06/10/2002, 1:42 PM

Pls advise simplest way to format a date field for UK dd/mm/yyyy format. (ASP).

TIA

Jay Ratansi

Alexey Alexapolsky
Posted: 06/13/2002, 6:56 AM

Make sure that given format is specified in your database.
Regional settings may affect it as weel. Here are functions
that may help you with it if you use SQL Server

Use form properties where you want to use date/time and formatting;
pick events.
Open event - ASP and Wrap checked
Dim CurrMonth, CurrDay, CurrYear, CurrDate
CurrMonth = Month(Date())
if Len(CurrMonth )=1 Then CurrMonth = "0" & CurrMonth
CurrDay = Day(Date())
if Len(CurrDay )=1 Then CurrDay = "0" & CurrDay
CurrYear = Year(Date())
CurrDate = CurrYear & "/" & CurrMonth & "/" & CurrDay

then in the Before Show/Before Insert/Before Update events:
If IsDate(fldGEBURTSDATUM) Then
fldGEBURTSDATUM = DatePart("yyyy", fldGEBURTSDATUM) & "-" & DatePart("m",
fldGEBURTSDATUM) & "-" & DatePart("d", fldGEBURTSDATUM)
End If

If IsDate(fldENTLASSUNGSTERMIN) Then
fldENTLASSUNGSTERMIN = DatePart("yyyy", fldENTLASSUNGSTERMIN) & "-" &
DatePart("m", fldENTLASSUNGSTERMIN) & "-" & DatePart("d",
fldENTLASSUNGSTERMIN)
End If

If IsDate(fldERFDATUM) Then
fldERFDATUM = DatePart("yyyy", fldERFDATUM) & "-" & DatePart("m",
fldERFDATUM) & "-" & DatePart("d", fldERFDATUM)
End If



--
Alex
CodeCharge Developer


<info@sonal.co.uk> wrote in messagenews:ae330b$k2j$1@news.codecharge.com...
> Pls advise simplest way to format a date field for UK dd/mm/yyyy format.
(ASP).
>
> TIA
>
> Jay Ratansi
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.