Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Something Odd About GET DATE$ Command

Author
Message
SonicX
21
Years of Service
User Offline
Joined: 17th Oct 2003
Location:
Posted: 21st Dec 2003 17:17
Hello,
I want my program to display the date using the GET DATE$ command. Trouble is the displayed result is month/day/year instead of day/month/year. According to the instructions it's suppose to display month/day/year which is silly. So, is there any way around this so it displays day/month/year instead?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 21st Dec 2003 17:19
I don't know if there is a built in way to flop it round, but if there isn't then you'll need to parse the string and flip it round yourself.

-RUST-

VB.NET makes me all goose-pimply!
Chaos
21
Years of Service
User Offline
Joined: 8th Feb 2003
Location: United Kingdom
Posted: 21st Dec 2003 17:19
Hmm im not sure if their is but whats the problem?? its only in a different format??

Chaos


the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 21st Dec 2003 20:41
Try working out what day this is if you don't know which way around the day and month are. 2/8/03. Is it the 2nd aug or 8th feb.

If you are displaying the date you should really use the format the user has specified. You can change it in regional settings in the control panel.

I don't know how you would find the correct format to show the date to the user, perhaps with the windows api?

dbpro : p166mmx @ 233 : 256mb : sb 128pci : sis onboard
Trowbee
21
Years of Service
User Offline
Joined: 12th Apr 2003
Location: United Kingdom
Posted: 21st Dec 2003 22:06
In this case, you're lucky. The date is always a fixed length:
MM/DD/YY (so 1/1/03 is 01/01/03 etc).



This is easier than splitting the string, based on "/" and returning value's that way.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 22nd Dec 2003 00:08 Edited at: 22nd Dec 2003 00:09
trowbee

although that will work it is not what should be done, because if something in the way dbp returns dates changes your code blows up. If you parse the return string based on the "/" then you wont have to change the parsing code regardless/of/what/lee/sticks/in/between/the/slashes

-RUST-

VB.NET makes me all goose-pimply!
Trowbee
21
Years of Service
User Offline
Joined: 12th Apr 2003
Location: United Kingdom
Posted: 22nd Dec 2003 06:10
oh yeah, I know that..I just provided an easy way of doing it.
Besides, the date format *shouldn't* change, because of the fact that it would blow up many, many (and so on) peoples' code (wow, have I just discovered how to take down computers, by sending them a compiled version of this code lol).
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Dec 2003 08:28
I've never seen anyone write the date like day/month/year. Does it really matter?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 22nd Dec 2003 08:34
Phaelax, you don't get out much, do you?
The entire world uses day/month/year, only us idiots (you included) uses month/day/year.

there is a world beyond the borders of the US, you know.

-RUST-

VB.NET makes me all goose-pimply!
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Dec 2003 19:59
Not quite the entire world. I believe that some regions use year/month/day

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 22nd Dec 2003 20:41
true true

-RUST-

VB.NET makes me all goose-pimply!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Dec 2003 23:42
I have to date my programs in java using year/month/day format. Just what my teacher wants. Call me an idiot again, I'll brand you like a cow Bob.
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 23rd Dec 2003 01:09



-RUST-

VB.NET makes me all goose-pimply!

Login to post a reply

Server time is: 2024-11-25 21:31:16
Your offset time is: 2024-11-25 21:31:16