Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/prelude/Time/ToClockTime.gc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


module Time where

import NHC.GreenCard
import DClockTime
import DCalendarTime

%-#include <time.h>
%-
%fun toClockTime :: CalendarTime -> ClockTime
%call (calendarTime y mon d h min s pc wd yd tzn tz dst)
%code
%  struct tm cal;
%  cal.tm_year = y;
%  cal.tm_mon  = mon;
%  cal.tm_mday = d;
%  cal.tm_hour = h;
%  cal.tm_min  = min;
%  cal.tm_sec  = s;
%  cal.tm_wday = wd;
%  cal.tm_yday = yd;
%  cal.tm_isdst = dst;
%  ct = mktime(&cal);
%result (clockTime ct)


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.