Extracting day,month,year from a datetime variable 

Extracting information from datetime variable.

DateTime d = DateTime.Today;

d.Day -> Extracts the day
d.Month-> Extracts the month
d.Year -> Extracts the year

Similarly TimeOfDay,Ticks,Seconds,Minute,Millisecond,Hour,DayOfWeek,DayOfYear can also be extracted.
If you found this solution helpful or have something extra to add, feel free to share it here by commenting below.


Google Webdriver Forum -The Online Community for Google Webdriver and Selenium RC Users and Professionals
1 response to “Extracting day,month,year from a datetime variable”
  1. Usman says:

    On which platform its work?

Leave a Reply