3 Replies - 6572 Views - Last Post: 13 January 2013 - 03:58 AM Rate Topic: -----

#1 Evgeniy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 01-September 09

Date in the following format - Year/Month/Day

Post icon  Posted 25 September 2009 - 11:42 AM

Hey guys, I am trying to get the current date in the following format - Year/Month/Day

Here is my code but the day bit isn't working...

		lblTodaysDate.Text = Year(Now).ToString() & "/" & Month(Now) & "/" & d(Now)


Thanks
Is This A Good Question/Topic? 0
  • +

Replies To: Date in the following format - Year/Month/Day

#2 crepitus  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 84
  • View blog
  • Posts: 383
  • Joined: 08-September 09

Re: Date in the following format - Year/Month/Day

Posted 25 September 2009 - 02:06 PM

Now.ToString("yyyy/MM/dd")

See MSDN: Custom Date and Time Format Strings

This post has been edited by crepitus: 25 September 2009 - 02:07 PM

Was This Post Helpful? 1
  • +
  • -

#3 Evgeniy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 01-September 09

Re: Date in the following format - Year/Month/Day

Posted 26 September 2009 - 03:06 AM

Thank you! Worked perfectly
Was This Post Helpful? 0
  • +
  • -

#4 vecdi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 13-January 13

Re: Date in the following format - Year/Month/Day

Posted 13 January 2013 - 03:58 AM

Hi,

you can use
[TextBox1.Text = Today.Year & "/" & Today.Month & "/" & Today.Day] it works 100%
or

DatePart(DateInterval.Year, Today)....!!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1