|
| |
|
|
OscarSierra
Posts: 179 Joined: 5/14/2004 From: Norway Status: offline
|
Date and time formats - 8/2/2006 8:44:44
During a search for some datetime problems (drives me crazy sometimes....), I found this: http://psacake.com/web/ef.asp Maybe you all know them, but for me it was a very useful page! - Oystein
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Date and time formats - 8/2/2006 9:37:10
Lots of handy lil' ASP functions there. Thanks.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
davids
Posts: 211 Joined: 1/26/2003 From: Belgium (American) Status: offline
|
RE: Date and time formats - 8/2/2006 17:48:04
LLLune, This is tricky, because with ASP there is no real process running for your app - it only responds to requests. Also, if no one uses your site for a while the application itself stops to conserve server resources. So, even if you could set a timer, it would only work if someone was using your application. We needed to generate new reminders every Sunday for incomplete items from the week before. Here's how we solved it. First we created a file "timecheck" in the data folder so it has write permissions. This is just a text file with the datetime string. Then we created a function included in the site home page that checks the timecheck file. If the date is within the last 7 days do nothing, else run the code that generates the reminders and update the timecheck file. With some variation this idea could be used to check for elapsed time over any period or only for certain types of users, etc.
_____________________________
Davids International Relocation Technology
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Date and time formats - 8/2/2006 18:39:13
rdouglass, Yeah this script/function needs to run in real-time. Specifically it needs to be a general script, was thinking cgi or something, that reads the time once every minute or so, then if the time matches a predetermined time, activate a script and carries out a task. We have distributors that like to email things they find on our site to a private list of their own clients. So they find an item on our site, they program it for a certian date and time. And on that date and time, the item gets emailed out to the distributor' clients. Right now I got a guy who has to sit by the computer and check the times that people programmed in. If the current time matches the programmed time, he manually sends out the item by email. We have all the systems in place to find a product, set it up to transmit, program the system, etc. We just need something that can read the current time, compare it to the time they programmed, then when the two are equal, the script starts and the transmitting goes into motion. One of our main competitions already has this system setup and are using it great - http://www.constantcontact.com/index.jsp. Was hoping we could do the same. But it's this timer thing that we can't figure out. davids, Very interesting. Thanks for laying that out for me. This is something I want my guys to see. Yeah, .asp can't accomplish a task like this. Neither can VB. We went through every function in vb and can't fnd anything in real time. Someone else told me cgi. Don't know that though. The script itself does not have to be asp or vb, but (I guess) as long as it can return a string to the current date and time - that can be read by one of our scrpts, we might be on our way to solving this. The technology is out there, like I said, someone else got it and it works great for them. Of course, they aren't going to tell me how it was done. I guess an industry secret. In fact, there's about 10 sites that I know of that do the exact same thing we're trying to do.
_____________________________
|
|
|
|
davids
Posts: 211 Joined: 1/26/2003 From: Belgium (American) Status: offline
|
RE: Date and time formats - 8/3/2006 4:08:01
Ah, well then I think you will need to work outside IIS, creating an independent process that would run on the server under windows/linux that would use the same database to check and send email. This means you would need a dedicated server - cheaper probably than having a guy doing this manually. I'm not the tech brains around here, but that's my take on it.
_____________________________
Davids International Relocation Technology
|
|
|
|
OscarSierra
Posts: 179 Joined: 5/14/2004 From: Norway Status: offline
|
RE: Date and time formats - 8/3/2006 10:06:55
Maybe I'm not following you, but why not use a batch file to kick the process alive ? you can make it start running whenever and as many times as you want with a scheduled task on the server........ I use that frequently to a lot of things - Oystein
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Date and time formats - 8/3/2006 10:48:30
This thread is not for questions but discussion regarding the tools and techniques. For questions, could you please create a new thread?
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
Reflect
Posts: 4769 From: USA Status: offline
|
RE: Date and time formats - 8/3/2006 15:39:24
Cron job??? Take care, Brian
_____________________________
|
|
|
|
yb2
Posts: 653 Joined: 1/30/2006 Status: offline
|
RE: Date and time formats - 8/4/2006 17:51:48
Another datetime hint. If you're vexed about UK dates in the database being stored in US format and you have to convert it all the time then use the longer date formats to enter into the database Instead of 4/8/06 or 8/4/06 use 8 Aug 2006 or Aug 8 06 and you'll never have a problem again.
_____________________________
it is natural for people not to see one's own faults, and to exaggerate other people's faults and failings. Currently listening to: L'Enfer Des Formes by Stereolab
|
|
|
|
Shona Smith
Posts: 24 Joined: 4/19/2005 Status: offline
|
RE: Date and time formats - 8/7/2006 5:10:16
Hi Thanks for you help but it is the information in the database I want to be stored in GB format in the Timestamp. Even if I change in the database to Long Date format it submits it as 8th July instead of 7th August. Any ideas? Cheers Shona
|
|
|
|
davids
Posts: 211 Joined: 1/26/2003 From: Belgium (American) Status: offline
|
RE: Date and time formats - 8/7/2006 5:20:48
Hi Shona, In fact, the date is not stored in the database in any format - even US or European. It is simply a number, like 1025.45. To the left of the decimal are days (after a certain date, which depends on the database), while to the right are parts of a day. You can look more up about that. What does it mean? When you look at the date in your database, it shows it formatted according to the database settings or your regional settings. That is what you would need to change to see it presented differently.
_____________________________
Davids International Relocation Technology
|
|
|
|
Shona Smith
Posts: 24 Joined: 4/19/2005 Status: offline
|
RE: Date and time formats - 8/7/2006 5:47:07
Hi I looked at this before my regional settings are set to English (United Kingdom) so I don't really know why it still insists on submitting as mm/dd/yy. Cheers
|
|
|
|
yb2
Posts: 653 Joined: 1/30/2006 Status: offline
|
RE: Date and time formats - 8/7/2006 6:29:19
this might help http://www.4guysfromrolla.com/webtech/041001-1.shtml the dates are stored as numbers (as is everything) but converted by MS databases into US format, which is equivalent to what I said but not the same! :) I should be more precise or someone on here will always catch me out! :D btw, you don't change the database format to Long Date, you change your web pages format to Long Date style. If your database is in long but your web pages are using 7/8/06 then that will be interpretted as 7th August. You need to use 8th July 06 from the webpage.
_____________________________
it is natural for people not to see one's own faults, and to exaggerate other people's faults and failings. Currently listening to: L'Enfer Des Formes by Stereolab
|
|
|
|
Shona Smith
Posts: 24 Joined: 4/19/2005 Status: offline
|
RE: Date and time formats - 8/7/2006 7:37:23
Hi Thanks for this that is absolutely spot on. You are a star Cheers Shona
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|