Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Problem With Date Functions
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem With Date Functions

 Post Reply Post Reply
Author
meteor View Drop Down
Groupie
Groupie
Avatar

Joined: 31 August 2003
Location: Iran
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote meteor Quote  Post ReplyReply Direct Link To This Post Topic: Problem With Date Functions
    Posted: 02 June 2004 at 11:26am

Hello

I am Using date(now()) function to return Todaye Date but When i Use day() and month() functions it cant distinct between(?) day and month. date(now()) return date in this Format: 6/2/2004 that is mm/dd/yyyy but when i use function to separate day it use month. i cant change it to return date as Follow: 2004/02/05.

Sincerely
--------------------
PowerFull Scripts For NTTacPlus
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2004 at 11:47am

Try Something like....


Dim strYYYY
Dim strMM
Dim strDD
Dim dtDateNow
Dim strDateFormatted

dtDateNow = Now

strYYYY = CStr(DatePart("yyyy", dtDateNow))

strMM = CStr(DatePart("m", dtDateNow))
If Len(strMM) = 1 Then strMM = "0" & strMM

strDD = CStr(DatePart("d", dtDateNow))
If Len(strDD) = 1 Then strDD = "0" & strDD

strDateFormatted = strYYYY & "/" & strMM & "/" & strDD


Lead me not into temptation... I know the short cut, follow me.
Back to Top
meteor View Drop Down
Groupie
Groupie
Avatar

Joined: 31 August 2003
Location: Iran
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote meteor Quote  Post ReplyReply Direct Link To This Post Posted: 03 June 2004 at 3:04am
tanx It Work Properly. tanx DP
Sincerely
--------------------
PowerFull Scripts For NTTacPlus
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 03 June 2004 at 1:39pm
My pleasure.

Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.