OmniSciDB  2e3a973ef4
anonymous_namespace{ExtractFromTime.cpp} Namespace Reference

Functions

DEVICE unsigned iso_week_start_from_yoe (unsigned const yoe)
 

Function Documentation

◆ iso_week_start_from_yoe()

DEVICE unsigned anonymous_namespace{ExtractFromTime.cpp}::iso_week_start_from_yoe ( unsigned const  yoe)

Definition at line 33 of file ExtractFromTime.cpp.

Referenced by extract_week().

33  {
34  unsigned const march1 = yoe * 365 + yoe / 4 - yoe / 100;
35  unsigned const jan4 = march1 + (31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 + 3);
36  unsigned const jan4dow = (jan4 + 2) % 7; // 2000-03-01 is Wed so + 2 to get Mon = 0.
37  return jan4 - jan4dow;
38 }
+ Here is the caller graph for this function: