Ada 编程/库/Ada.Calendar
外观
此语言特性从 Ada 95 开始可用。
Ada.Calendar 是 预定义语言环境 自 Ada 95 以来的一部分。
-- Standard Ada library specification -- Copyright (c) 2003-2018 Maxim Reznik <[email protected]> -- Copyright (c) 2004-2016 AXE Consultants -- Copyright (c) 2004, 2005, 2006 Ada-Europe -- Copyright (c) 2000 The MITRE Corporation, Inc. -- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc. -- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual -- -------------------------------------------------------------------------package
Ada.Calendaris
type
Timeis
private
;subtype
Year_Numberis
Integerrange
1901 .. 2399;subtype
Month_Numberis
Integerrange
1 .. 12;subtype
Day_Numberis
Integerrange
1 .. 31;subtype
Day_Durationis
Durationrange
0.0 .. 86_400.0;function
Clockreturn
Time;function
Year (Date : Time)return
Year_Number;function
Month (Date : Time)return
Month_Number;function
Day (Date : Time)return
Day_Number;function
Seconds(Date : Time)return
Day_Duration;procedure
Split (Date :in
Time; Year :out
Year_Number; Month :out
Month_Number; Day :out
Day_Number; Seconds :out
Day_Duration);function
Time_Of(Year : Year_Number; Month : Month_Number; Day : Day_Number; Seconds : Day_Duration := 0.0)return
Time;function
"+" (Left : Time; Right : Duration)return
Time;function
"+" (Left : Duration; Right : Time)return
Time;function
"-" (Left : Time; Right : Duration)return
Time;function
"-" (Left : Time; Right : Time)return
Duration;function
"<" (Left, Right : Time)return
Boolean;function
"<="(Left, Right : Time)return
Boolean;function
">" (Left, Right : Time)return
Boolean;function
">="(Left, Right : Time)return
Boolean; Time_Error :exception
;private
pragma
Import (Ada, Time);end
Ada.Calendar;
外部示例
[编辑源代码]- 在以下网站搜索
Ada.Calendar
的示例: Rosetta Code、GitHub (gists)、任何 Alire 包 或 本维基教科书。 - 在以下网站搜索与
Ada.Calendar
相关的帖子: Stack Overflow、comp.lang.ada 或 任何与 Ada 相关的页面。
FSF GNAT
- 规范: a-calend.ads
- 主体: a-calend.adb
drake