Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
829 B

  1. //===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose: components of tier0 PLAT_ with (at least mostly) platform independent implementations.
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #include "pch_tier0.h"
  8. #include <time.h>
  9. void GetCurrentDayOfTheWeek( int *pDay )
  10. {
  11. struct tm *pNewTime;
  12. time_t long_time;
  13. time( &long_time ); /* Get time as long integer. */
  14. pNewTime = localtime( &long_time ); /* Convert to local time. */
  15. *pDay = pNewTime->tm_wday;
  16. }
  17. void GetCurrentDayOfTheYear( int *pDay )
  18. {
  19. struct tm *pNewTime;
  20. time_t long_time;
  21. time( &long_time ); /* Get time as long integer. */
  22. pNewTime = localtime( &long_time ); /* Convert to local time. */
  23. *pDay = pNewTime->tm_yday;
  24. }