Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/prelude/Time/ToUTCTime.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 toUTCTime :: ClockTime -> CalendarTime
%call (clockTime ct)
%code
%  struct tm *cal;
%  cal = gmtime(&ct);
%result (calendarTime "1900+cal->tm_year" "cal->tm_mon" "cal->tm_mday" "cal->tm_hour" "cal->tm_min" "cal->tm_sec" "0" "cal->tm_wday" "cal->tm_yday" "(char*)0" "0" "cal->tm_isdst")

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.