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.

Code Snippets / [DBP] Show the date with day and month as words.

Author
Message
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 29th Jan 2010 20:15 Edited at: 6th Apr 2010 21:05
Have ever wanted to show the date like so

Friday 29th Janaury 2010 day:29 week:4

well now you can.

updated 6/4/10 with the below Ideas added.



Dark Physics makes any hot drink go cold.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Jan 2010 21:59
Why not just put the days and months into an array rather than using all those IF statements?


"Any sufficiently advanced technology is indistinguishable from magic" ~ Arthur C. Clarke
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 29th Jan 2010 22:17 Edited at: 29th Jan 2010 22:59
how would that work, I'd still need to use the if statment to get the right one.

Phaelax like to show how you mean.

edit
I think you were mean something like this.



Dark Physics makes any hot drink go cold.
Tone Dialer
Valued Member
18
Years of Service
User Offline
Joined: 17th Oct 2005
Location: England, well a town in it !
Posted: 31st Jan 2010 15:17
@HowDo

Neat little program, but needs a bit more work, todays date comes out as 31th instead of 31st

HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 31st Jan 2010 15:25 Edited at: 31st Jan 2010 15:30
wonder about that weather anyone would spot it, simple change of few lines



Dark Physics makes any hot drink go cold.
Tone Dialer
Valued Member
18
Years of Service
User Offline
Joined: 17th Oct 2005
Location: England, well a town in it !
Posted: 1st Feb 2010 08:29 Edited at: 1st Feb 2010 08:30
@HowDo

Nearly there, 21st, 22nd and 23rd dont work yet, how about this...



HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 1st Feb 2010 12:04 Edited at: 1st Feb 2010 12:35
like that Tone Dialer stop all clutter in the code, I think I will now update the first one so that when someone looks at it they will get the right one first time.

on another look I dont think the week counter it working as it should, anyone got any ideas on what would work better?

well my quick way was to do this



have now added write date string and also checks to see if day has changed.

Dark Physics makes any hot drink go cold.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Feb 2010 00:13
Quote: "wonder about that weather anyone would spot it, simple change of few lines"


now you're a proper software engineer, releasing code with known bugs. I think MS has a position for you.


"Any sufficiently advanced technology is indistinguishable from magic" ~ Arthur C. Clarke
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Feb 2010 00:42
well that how they do it with cars, they let us part with that hard earned cash on a new one, only for us to be the test pilot on the prototype, then they update it and it gets done on the next service, unless its to do with safety then they recall them all...

Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 5th Feb 2010 22:55 Edited at: 5th Feb 2010 23:03
had to added this to it so I can find it late on.

It show length of time its been running.



Dark Physics makes any hot drink go cold.
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 6th Apr 2010 20:46 Edited at: 6th Apr 2010 21:06
Did have a problem, now fixed. above first post code now work correctly gives the correct day and numbers of weeks.

Dark Physics makes any hot drink go cold.

Login to post a reply

Server time is: 2024-04-20 02:51:31
Your offset time is: 2024-04-20 02:51:31