CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Problems with Date format/insert in CodeCharge

Print topic Send  topic

Author Message
Doru Apostolescu
Posted: 03/01/2002, 5:30 AM

This is a multi-part message in MIME format.

------=_NextPart_000_000D_01C1C134.77F52820
Content-Type: text/plain;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

I have a problem with dates in my application.
I am working with Access DB placed on an IIS5.0/Win2000Server.
I need to work with dates in DD/MM/YYYY format.=20
I have made the changes in the locale setting of the server, so when i =
request a date from the server in an ASP page the date returned is in =
the right format.
But even if in the record form (when i insert) the date is in DDMMYYYY =
format, in DB the date is recorded as MMDDYYYY.
The funny part is that when i insert dates with days greater than 12 =
(ex. 13-3-2002) the date recorded in DB is in the DD/MM/YYYY, if i =
insert a date with day lower or equal to 12 (10-3-2002) the date is =
recorded in MMDDYYYY format, resulting in 3-10-2002.

The only way to record the correct date is to insert the date in MMDDYYY =
format so the date will be recorded in DB as DDMMYYYY format, wich is =
not a solution.

Where is the problem, who is messing with my dates ?

Thank you for any answer !
------=_NextPart_000_000D_01C1C134.77F52820
Content-Type: text/html;
charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-2">
<META content=3D"MSHTML 5.50.4913.1100" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>I have a problem with =
dates in my=20
application.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>I am working with =
Access DB placed=20
on an IIS5.0/Win2000Server.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>I need to work with =
dates in=20
DD/MM/YYYY format. </FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>I have made the =
changes in the=20
locale setting of the server, so when i request a date from the server =
in an ASP=20
page the date returned is in the right format.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>But even if in the =
record form (when=20
i insert) the date is in DDMMYYYY format, in DB the date is recorded as=20
MMDDYYYY.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>The funny part is that =
when i insert=20
dates with days greater than 12 (ex. 13-3-2002) the date recorded in DB =
is in=20
the DD/MM/YYYY,  if i insert a date with day lower or equal to 12=20
(10-3-2002) the date is recorded in MMDDYYYY format, resulting in=20
3-10-2002.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>The only way to record =
the correct=20
date is to insert the date in MMDDYYY format so the date will be =
recorded in DB=20
as DDMMYYYY format, wich is not a solution.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>Where is the problem, =
who is messing=20
with my dates ?</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>Thank you for any =
answer=20
!</FONT></DIV></BODY></HTML>

------=_NextPart_000_000D_01C1C134.77F52820--
keijen
Posted: 03/03/2002, 1:08 PM

I assume you're using vbscript (ASP)?

VBScript uses only mm/dd/yyyy format. This is true even if your have a
different locale on your machine!

We use dd/mm/yyyyy and feed all dates in and out with these functions in the
appropriate events.

Function ShowDate(Field)
If IsDate(Field) Then
ShowDate= DatePart("d", Field) & "." & DatePart("m", Field) & "." &
DatePart("yyyy", Field)
End If
end Function
'_______________________________________________________
Function SaveDate(Field)
If IsDate(Field) Then
SaveDate= DatePart("m", Field) & "/" & DatePart("d", Field) & "/" &
DatePart("yyyy", Field)
End If
end Function
'_______________________________________________________

"Doru Apostolescu" <doru@tehnoplus.com> wrote in message
news:a5nvpp$3ql$1@news.codecharge.com...
I have a problem with dates in my application.
I am working with Access DB placed on an IIS5.0/Win2000Server.
I need to work with dates in DD/MM/YYYY format.
I have made the changes in the locale setting of the server, so when i
request a date from the server in an ASP page the date returned is in the
right format.
But even if in the record form (when i insert) the date is in DDMMYYYY
format, in DB the date is recorded as MMDDYYYY.
The funny part is that when i insert dates with days greater than 12 (ex.
13-3-2002) the date recorded in DB is in the DD/MM/YYYY, if i insert a date
with day lower or equal to 12 (10-3-2002) the date is recorded in MMDDYYYY
format, resulting in 3-10-2002.

The only way to record the correct date is to insert the date in MMDDYYY
format so the date will be recorded in DB as DDMMYYYY format, wich is not a
solution.

Where is the problem, who is messing with my dates ?

Thank you for any answer !

Doru Apostolescu
Posted: 03/04/2002, 2:33 AM

This is a multi-part message in MIME format.

------=_NextPart_000_027C_01C1C378.EEBADCC0
Content-Type: text/plain;
charset="windows-1250"
Content-Transfer-Encoding: quoted-printable

I have resolved the problem:

Since i get the correct date from server (DDMMYYYY) i inserted the =
folowing function in the BeforeInsert and BeforeUpdate events of the =
record form:

fldName =3D DatePart("d", fldName) & "/" & DatePart("m", fldName) & "/" =
& DatePart("yyyy", fldName)

that inserts and updates the corect date format in DB.
Its simpler than the solution proposed by Keijen and it works like a =
charm !
The getting of the correct date can be done by the same function, =
replacing fldName from the parameters of the DatePart function with =
Date.





"Doru Apostolescu" <doru@tehnoplus.com> wrote in message =
news:a5nvpp$3ql$1@news.codecharge.com...
I have a problem with dates in my application.
I am working with Access DB placed on an IIS5.0/Win2000Server.
I need to work with dates in DD/MM/YYYY format.=20
I have made the changes in the locale setting of the server, so when i =
request a date from the server in an ASP page the date returned is in =
the right format.
But even if in the record form (when i insert) the date is in DDMMYYYY =
format, in DB the date is recorded as MMDDYYYY.
The funny part is that when i insert dates with days greater than 12 =
(ex. 13-3-2002) the date recorded in DB is in the DD/MM/YYYY, if i =
insert a date with day lower or equal to 12 (10-3-2002) the date is =
recorded in MMDDYYYY format, resulting in 3-10-2002.

The only way to record the correct date is to insert the date in =
MMDDYYY format so the date will be recorded in DB as DDMMYYYY format, =
wich is not a solution.

Where is the problem, who is messing with my dates ?

Thank you for any answer !
------=_NextPart_000_027C_01C1C378.EEBADCC0
Content-Type: text/html;
charset="windows-1250"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dwindows-1250">
<META content=3D"MSHTML 5.50.4913.1100" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>I have resolved the=20
problem:</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>Since i get the =
correct date from=20
server (DDMMYYYY) i inserted the folowing function in the BeforeInsert =
and=20
BeforeUpdate events of the record form:</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#ff0000 size=3D2>fldName =3D =
DatePart("d", fldName)=20
& "/" & DatePart("m", fldName) & "/" & DatePart("yyyy",=20
fldName)</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#ff0000 size=3D2><FONT face=3DArial=20
color=3D#000000></FONT> </DIV></FONT>
<DIV><FONT face=3DTahoma size=3D2><FONT color=3D#000080>that inserts and =
updates the=20
corect date format in DB.</FONT></FONT></DIV>
<DIV><FONT face=3DTahoma size=3D2><FONT color=3D#000080>Its simpler than =
the solution=20
proposed by Keijen and it works like a charm !</FONT></FONT></DIV>
<DIV><FONT face=3DTahoma size=3D2><FONT color=3D#000080>The getting of =
the correct=20
date can be done by the same function, replacing fldName from the =
parameters of=20
the DatePart function with Date.</FONT></FONT></DIV>
<DIV><FONT face=3DTahoma size=3D2><FONT =
color=3D#000080></FONT></FONT> </DIV>
<DIV><FONT face=3DTahoma size=3D2><FONT =
color=3D#000080></FONT></FONT> </DIV>
<DIV><FONT face=3DTahoma size=3D2><FONT =
color=3D#000080></FONT></FONT> </DIV>
<DIV><FONT face=3DTahoma size=3D2><FONT =
color=3D#000080></FONT></FONT> </DIV>
<DIV><FONT face=3DTahoma size=3D2><FONT=20
color=3D#000080></FONT> </DIV></FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Doru Apostolescu" <<A=20
href=3D"mailto:doru@tehnoplus.com">doru@tehnoplus.com</A>> wrote in =
message=20
<A=20
=
href=3D"news:a5nvpp$3ql$1@news.codecharge.com">news:a5nvpp$3ql$1@news.cod=
echarge.com</A>...</DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>I have a problem =
with dates in my=20
application.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>I am working with =
Access DB placed=20
on an IIS5.0/Win2000Server.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>I need to work with =
dates in=20
DD/MM/YYYY format. </FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>I have made the =
changes in the=20
locale setting of the server, so when i request a date from the server =
in an=20
ASP page the date returned is in the right format.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>But even if in the =
record form=20
(when i insert) the date is in DDMMYYYY format, in DB the date is =
recorded as=20
MMDDYYYY.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>The funny part is =
that when i=20
insert dates with days greater than 12 (ex. 13-3-2002) the date =
recorded in DB=20
is in the DD/MM/YYYY,  if i insert a date with day lower or equal =
to 12=20
(10-3-2002) the date is recorded in MMDDYYYY format, resulting in=20
3-10-2002.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>The only way to =
record the correct=20
date is to insert the date in MMDDYYY format so the date will be =
recorded in=20
DB as DDMMYYYY format, wich is not a solution.</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>Where is the =
problem, who is=20
messing with my dates ?</FONT></DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2></FONT> </DIV>
<DIV><FONT face=3DTahoma color=3D#000080 size=3D2>Thank you for any =
answer=20
!</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_027C_01C1C378.EEBADCC0--

   


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

Web Database

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.