dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: How can find weekday name?

  1. #1
    Join Date
    Jan 2008
    Location
    India
    Posts
    780

    How can find weekday name?

    Hi all,

    i have a date in dd/mm/yyyy format .

    i want to find weekday name with help of this.

    please tell me how can i do this.

    thanks in advance.
    IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,592

    Re: How can find weekday name?

    To obtain week day names for the current locale you can use GetLocaleInfo with the LOCALE_SDAYNAME1, ..., LOCALE_SDAYNAME7 parameters (Monday to Sunday).

    Also have a look at GetDateFormat API.
    Victor Nijegorodov

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: How can find weekday name?

    If you're using COleDateTime it has a method called GetDayOfWeek() that returns the day of week. You can use then GetLocaleInfo as Victor suggested.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,603

    Re: How can find weekday name?

    See my sample.

    One warning to be stated: be carefull with the date format and COleDateTime parsing. dd/mm/yyyy must be valid user locale date format, otherwise you have to parse the date string yourself (!!!)
    Attached Files Attached Files
    Best regards,
    Igor

  5. #5
    Join Date
    Jan 2008
    Posts
    178

    Re: How can find weekday name?

    Do you think you're the first one in the world to do this ?!
    Google Groups => FAQ for ~20 years => found in 0.35 seconds..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)