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

Thread: some help here

  1. #1
    Guest

    some help here

    i wanna show the day of the week in a label.
    like monday, tuesday, and so on
    for each time i load the game it shows the day of the week
    in the label.
    the time,date i know. i looked through my books and cant find nothing
    on this weekday thing.
    any help would be appreciated. q;o



  2. #2
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: some help here

    Weekday(dateval, Firstdayofweek) fn returns an integer for the day specified by dateval taking the value Firstdayofweek as base. By default system settings are taken
    Associate this value to a string with "select Case" statement.
    Ravi Kiran


    "We cannot solve problems with the same thinking we used when we created them." - Einstein

  3. #3
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: some help here

    >Associate this value to a string with "select Case" statement.

    I wouldn't suggest doing that unless you know that your code is only going to be run in one country - take a look at the code in http://www.codeguru.com/vb/articles/1716.shtml to see how to get the 'proper' month/day names from windows (in the current language) using the API (you can still use the WeekDay / other functions though)



    Chris Eastwood

    CodeGuru - the website for developers
    http://www.codeguru.com/vb

  4. #4
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: some help here

    Good link. and that was a good work too.

    Being in Japan and developing s/w in English, i know how important internationalisation is!.

    That's why in that example i just left it at based on "select case" logic.

    In my case i have my own code that does these.
    Incidentally, Japanese "year" is totally different and is based on "Emperor" of Japan.
    AFAIK, Windows doesn't provide a way to calculate it too.

    "We cannot solve problems with the same thinking we used when we created them." - Einstein

  5. #5
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: some help here

    Hi Ravi

    How does handling the 'Emporer' year and Y2K affect development ? Just wondering - sure sounds like a lot of work !

    Chris Eastwood

    CodeGuru - the website for developers
    http://www.codeguru.com/vb

  6. #6
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: some help here

    Hi Chris,

    I think, For those Jap. programs with 2year dates
    and use Christian calender, it probably is same as else where.

    For this emperor case, they usually have one or 2 chars before the number to tell which 'Era' it is and then the year num and the year symbol. The month and date are same as Christian calender.

    Actually these date formats are often used and by most people too. So, the problem of "roll-over" of years is actually not new to Japanese:-) With every emperor change it probably rolls over.

    So, as a permanent solution, most people might have stored their dates in 4 year format right from the beginning itself, and at display time they convert the date to as required (like my program does - i store the date in date-time field )

    There is a std. procedure in converting Christian dates to Jap.Era dates. I didn't bother to understand. I took it from my Jap. collegue, (in C, and converted to VB)

    ---
    I was wrong in my prev. post. Windows does provide this convertion. EnumCalenderInfo
    But i never used it!!
    --

    I included a bit map to show these tho dates:


    Ravi Kiran


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured