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

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Closed)
 V33(.03) BUG+FIX: StrToDate
 Forum Locked  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 3

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 11 August 2002 :  18:35:08  Show Profile  Visit HuwR's Homepage
DatePart("d",strForumTimeAdjust) & "-" & Monthname(DatePart("m",strForumTimeAdjust))


this could be 11th of august or 8th of November so you could be using cdate on the wrong date

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 August 2002 :  19:00:03  Show Profile  Send ruirib a Yahoo! Message
Well I thought DatePart also used system date settings. I haven't seen a reference to that in MSDN, though, but nevertheless DatePart is also used in my own version.



Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 11 August 2002 :  19:32:20  Show Profile
The value in strForumTimeAdjust is date Data Type.

From config.asp
strForumTimeAdjust = DateAdd("h", strTimeAdjust , Now())


quote:
Huwr:
DatePart("d",strForumTimeAdjust) & "-" & Monthname(DatePart("m",strForumTimeAdjust)) 


this could be 11th of august or 8th of November so you could be using cdate on the wrong date



No. The day and month will always be picked correctly as all date functions will be processed on the same server. Neither Ruirib nor mine function will fail.

quote:
HUWR:
I have seen them saved as YYYYDDMMHHMMSS


That was happening in function ReadLasthereDate and I remember that was also discussed in my earliest discussions on Date Swapping.

quote:
HUWR:
you will get a different result for monthname depending on the server because datepart 'm' will not be the same, hence the reason ruirib compares an actual date to see whether the function returns it as the correct month or not


DatePart("m",strForumTimeAdjust) and Month(strForumTimeAdjust)

Both will always return the same value. They are processed on the same server. ruirib uses the "Month" function to get the month number.

quote:
ruirib:
Besides the elegance of the solution, I think the differences between both are minimal. StrToDate doesn't get called that many times to make a significative difference in performance, the extra call to strComp and the additional if "my" function adds.



The performance gain will not be noticeable because both take very small time in processing. However I did a For Next with 500 iterations on both the logics, mine completed in less than 50% of time as compared to ruirib's function. But since the total amount taken was too low in both cases. So performance gain is minimal in terms of total time.

quote:
ruirib:
Since both DatePart and cDate use the server date and time settings, I think this time Gaurav's suggestion really works. I also think it's a more elegant solution and I like elegant solutions.




CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 11 August 2002 :  20:19:57  Show Profile  Visit HuwR's Homepage
well, I tried your function instead and had to change back because it broke the evends mod

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 11 August 2002 :  20:30:03  Show Profile
How did it break the events Mod. I am using it with events Mod and I have not noticed any problems. Can you please post some details.
Thanks

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 August 2002 :  20:39:42  Show Profile  Send ruirib a Yahoo! Message
Hmmm, I must have missed something... I did test it just with the same tests I had done to my own...


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 11 August 2002 :  20:59:53  Show Profile  Visit HuwR's Homepage
when I went to creat a new event it was swapping the month and day, so rather than create one for the 9th of aug it created one for the 8th of september.

But then the event calendar is infamous for behaving oddly with dates

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 August 2002 :  21:06:12  Show Profile  Send ruirib a Yahoo! Message
Funny, and it works ok with my version?


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 11 August 2002 :  21:30:17  Show Profile
HUWR, I tried to add an event for 9-Aug-2002 at your magicmushrooms site. For the event on 9-Aug-2002 it shows
Starts: 12/8/2002 2:26:50
Ends: 12/08/2002

There are some problems with date picker, I will post at your site.

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 12 August 2002 :  05:08:59  Show Profile  Visit HuwR's Homepage
ruirib,
What you have to remember, is my site has a timezone mod, so dates behave a little differently sometimes, and this may end up in v4.

gaurav,
thanks for the heads up, will look at it later

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

mortioli
Average Member

United Kingdom
898 Posts

Posted - 20 August 2002 :  14:26:11  Show Profile  Visit mortioli's Homepage  Send mortioli an AOL message  Send mortioli a Yahoo! Message
Not sure if this is part of this, but when I click on the Birth Date link in Edit Profile, the pop-up box appears, and I get this error on the right:


Microsoft VBScript runtime error '800a000d'

Type mismatch: 'strCurrentDate'

/cky/forum/pop_datepicker.asp, line 382



I apologise if this has already been covered
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 August 2002 :  20:15:05  Show Profile
no, this is a problem in the pop_datepicker.asp file itself. It doesn't use the main forum functions because the date isn't stored with a time, just YYYYMMDD. I was trying to make it as date non-dependent as possible, but that didn't work out.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 August 2002 :  20:32:06  Show Profile
Richard, I have fixed the datepicker. It works okay now. The Other Topic is locked so, I can not post in there. I also sent you an email using the link from your profile.
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 20 August 2002 :  20:39:36  Show Profile
since it was taking too long to fix, I just removed it and replaced it with dropdown boxes to pick the month/day/year for your birthday. Date checking is done after the form is submitted to make sure that the date entered is valid (no February 31 for example).
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 August 2002 :  20:50:18  Show Profile
Well, as I said, It is fixed, so it is upto you.
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page | Next Page
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07