Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

date problem c++

conioconio Member Posts: 1
Hi I have problem with program which should display date, program should ask user to enter: number of the day ex:23, number of the month ex:12, end program should display : ex: today is monday 23 of december, to display months ok, but with days am going crazy, please help me if you can. Big THX in advance.

Comments

  • stoberstober Member Posts: 9,765 ✭✭✭
    : Hi I have problem with program which should display date, program should ask user to enter: number of the day ex:23, number of the month ex:12, end program should display : ex: today is monday 23 of december, to display months ok, but with days am going crazy, please help me if you can. Big THX in advance.
    :


    .NET probably has a managed c++ class, but I would use the functions in time.h, such as time() to get current time as a size_t integer, and localtime() to get struct tm pointer. Once you have that struct you can easily pick out the values you want. Or you can pass the struct on to strftime() to format the string the way you want.
Sign In or Register to comment.