找回密码
 注册
查看: 533|回复: 0

About the date and week

[复制链接]
发表于 2005-8-1 13:11:50 | 显示全部楼层 |阅读模式
hi,all
Is there a function like get_day_of_week(), the input is a string like this:
"01-Aug-2005" and the return is the Number 1 to 7 stand for the Monday to Sunday, for example,

[code:1]
      int rc;
      rc = get_day_of_week("01-Aug-2005");
      switch rc
          case 1: printf("Monday!");break;
           ....
          case 7: printf("Sunday!);break;
[/code:1]



And the input date is not the current day,may be a day some years ago.


Now I want to konw is there a function in UNIX C, if not ,how can I write this function,,how can I convert the string to be a date !

any suggest will be helpful! thx![code:1][/code:1]
您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2025-2-8 06:54 , Processed in 0.022586 second(s), 15 queries .

© 2001-2025 Discuz! Team. Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表