Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 International Date/time format
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Johnyalm
New Member

Sweden
53 Posts

Posted - 11 March 2001 :  10:52:39  Show Profile  Visit Johnyalm's Homepage  Send Johnyalm a Yahoo! Message
I would like to use international date format in asp where the us format mm/dd/yyyy is converted to yyyy-mm-dd or yy-mm-dd and time in military format instead of in the format with am and pm.

Is there any way to ste this for a whole site, and/or set it for each time one works with/displays a date/time?

Johny Alm
www.mirrorgate.com

http://www.mirrorgate.com

gor
Retired Admin

Netherlands
5511 Posts

Posted - 11 March 2001 :  12:23:02  Show Profile  Visit gor's Homepage
You can change the displayed date/time format in the Admin Options > Server Date/Time configuration.

yy-mm-dd isn't a default supported format, though yy/mm/dd is.

If you really want yy-mm-dd you would have to edit inc_functions.asp

find the function chkDateTime(fDateTime) and change this code:

case "ymd"
chkDateTime = Mid(fDateTime,1,4) & "/" & _
Mid(fDateTime,5,2) & "/" & _
Mid(fDateTime,7,2)
to:

case "ymd"
chkDateTime = Mid(fDateTime,1,4) & "-" & _
Mid(fDateTime,5,2) & "-" & _
Mid(fDateTime,7,2)
and do the same for the function chkDate(fDate)

To complete the change, open admin_config_datetime.asp and change this line:
<option Value="ymd"<% if (lcase(strDateType)="ymd") then Response.Write(" selected") %>>2000/12/31 (Other short)</option>

to
<option Value="ymd"<% if (lcase(strDateType)="ymd") then Response.Write(" selected") %>>2000-12-31 (Other short)</option>





Pierre
Go to Top of Page

Johnyalm
New Member

Sweden
53 Posts

Posted - 11 March 2001 :  17:47:42  Show Profile  Visit Johnyalm's Homepage  Send Johnyalm a Yahoo! Message
Thank you Pierre!

www.mirrorgate.com


Edited by - Johnyalm on 11 March 2001 17:49:22
Go to Top of Page

Johnyalm
New Member

Sweden
53 Posts

Posted - 11 March 2001 :  17:52:50  Show Profile  Visit Johnyalm's Homepage  Send Johnyalm a Yahoo! Message
hmm, since this is an 'open' asp forum, not only devoted to snitz forum code, I would as well like to ask if this can be done in IIS 5 for a whole web site - so that IIS uses the date format I prefer?

www.mirrorgate.com
www.nkja.se
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 11 March 2001 :  18:03:14  Show Profile  Visit gor's Homepage
I don't know if this is possible, though I know that we had lots of problems when we tried controlling the actual date format used from within ASP-code.
Access uses the date format of the server to store dates, so even if you set the Session.LCID property storing it in the database can go wrong.
That is why we decided to store strings instead.

Pierre
Go to Top of Page

Dan Martin
Average Member

USA
528 Posts

Posted - 12 March 2001 :  16:11:53  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
Actually, if you are using a NT server, its alot simpler than you might think. Date functions like Now(), or new Date, return dates (and times) in format's from the servers system settings.

Go to Control Panel >>> Regional Settings. Under the Date tab, change the Date Style. Do the same under the Time tab.

After that, according to Microsoft, ASP will return dates in that format. Hope it works, because you know this USA person really never tested it out. I just read some of the MS propaganda.

-Dan



Go to Top of Page

Johnyalm
New Member

Sweden
53 Posts

Posted - 13 March 2001 :  01:42:51  Show Profile  Visit Johnyalm's Homepage  Send Johnyalm a Yahoo! Message
quote:

I don't know if this is possible, though I know that we had lots of problems when we tried controlling the actual date format used from within ASP-code.
Access uses the date format of the server to store dates, so even if you set the Session.LCID property storing it in the database can go wrong.
That is why we decided to store strings instead.

Pierre



Thanks, I found this resource on the session.LCID - http://askasp.com/articles.asp?ArtID=2.

Where can I find the date/time functions you
use in snitz forum . I would like to check them out. Are they in the same place in the same include?

www.mirrorgate.com
www.nkja.se
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 13 March 2001 :  02:10:58  Show Profile
all of the date/time functions are in inc_functions.asp
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 13 March 2001 :  03:08:47  Show Profile  Visit gor's Homepage
The functions to look for in inc_functions.asp are:

function DateToStr(dtDateTime) converts a date field to a string (before storing it in the database)
function StrToDate(strDateTime) converts a string-formatted date back to a date
These 3 functions take care of the conversion to the wanted date-format when displaying the date/time:
function ChkDateTime(fDateTime)
function ChkDate(fDateTime)
function Time(fDateTime)


Pierre
Go to Top of Page

StockholmStudent
Junior Member

Sweden
329 Posts

Posted - 16 March 2001 :  06:49:27  Show Profile  Visit StockholmStudent's Homepage  Send StockholmStudent an ICQ Message
I'd like the date/time format to be this:

23 januari 2005 15:35

With the swedish names to the months! How to do this!?

January = januari
February = februari
March = mars
April = april
May = maj
June = juni
July = juli
August = augusti
September = september
October = oktober
November = november
December = december


and with small letters - that's the way it's spelled in swedish!

Anyone knows how to do this!?

Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 25 April 2001 :  22:55:51  Show Profile
function ChkDateTime(fDateTime)

Can anyone give me an example of where this function is referenced? I did a search in a couple different sets of Snitz code I have and when I do a search for chkDateTime, I get the following results, but they are all inside the function itself. Nothing outside of the function.

Am I missing something? I understand what the function should be doing, but I can't figure out where/when it gets referenced.

Searching for: chkDateTime
inc_functions.asp(537): function chkDateTime(fDateTime)
inc_functions.asp(544): chkDateTime = Mid(fDateTime,7,2) & "/" & _
inc_functions.asp(548): chkDateTime = Mid(fDateTime,5,2) & "/" & _
inc_functions.asp(552): chkDateTime = Mid(fDateTime,1,4) & "/" & _
inc_functions.asp(556): chkDateTime =Mid(fDateTime,1,4) & "/" & _
inc_functions.asp(560): chkDateTime = Mid(fDateTime,7,2) & " " & _
inc_functions.asp(564): chkDateTime = Monthname(Mid(fDateTime,5,2),1) & " " & _
inc_functions.asp(568): chkDateTime = Mid(fDateTime,1,4) & " " & _
inc_functions.asp(572): chkDateTime = Mid(fDateTime,1,4) & " " & _
inc_functions.asp(576): chkDateTime = Mid(fDateTime,7,2) & " " & _
inc_functions.asp(580): chkDateTime = Monthname(Mid(fDateTime,5,2),0) & " " & _
inc_functions.asp(584): chkDateTime = Mid(fDateTime,1,4) & " " & _
inc_functions.asp(588): chkDateTime = Mid(fDateTime,1,4) & " " & _
inc_functions.asp(592): chkDateTime = doublenum(Mid(fDateTime,5,2)) & "/" & _
inc_functions.asp(598): chkDateTime = chkDateTime & " " & _
inc_functions.asp(603): chkDateTime = chkDateTime & " " & _
inc_functions.asp(608): chkDateTime = chkDateTime & " " & _
inc_functions.asp(613): chkDateTime = chkDateTime & " " & _
inc_functions.asp(619): chkDateTime = chkDateTime & " " & _
Found 19 occurrence(s) in 1 file(s)

Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 26 April 2001 :  00:27:10  Show Profile
work, I get the same results searching 3.2a6 distribution. Maybe the function is for a MOD and has gotten in the distribution inc_functions.

======
Doug G
======
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 26 April 2001 :  00:45:00  Show Profile  Visit HuwR's Homepage
It is not used, I gues it is probably left over from an older version.

Go to Top of Page

stealthc
Starting Member

21 Posts

Posted - 26 April 2001 :  02:12:24  Show Profile
Try deleting it. Make sure you back it up before you do this of course, but delete that function and see what happens.
Maybe nothing.
Maybe nothing not yet immediately noticeable.
Maybe it'll screw a couple of things up (or everything)...who knows. You're not going to find out unless you try something.


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07