Talk:C date and time functions: Difference between revisions

Content deleted Content added
Cewbot (talk | contribs)
m Maintain {{WPBS}} and vital articles: 1 WikiProject template. Create {{WPBS}}. Keep majority rating "Start" in {{WPBS}}. Remove 1 same rating as {{WPBS}} in {{WikiProject C/C++}}.
 
(12 intermediate revisions by 10 users not shown)
Line 1:
{{WikiProjectTalk C++header}}
{{WikiProject banner shell|class=Start|
{{IEP assignment|course=Wikipedia:India Education Program/Courses/Fall 2011/Data Structures and Algorithms|university=College Of Engineering Pune|term=2011 Q3}}
{{WikiProject C/C++|importance=High|c=yes}}
 
}}
== This is not C documentation ==
Wikipedia is not C documentation.
Line 12 ⟶ 13:
 
 
Also, it's not strictly correct. On at least some systems (most?) there is time.h and sys/time.h, which are not identical. It would be nice if Wikipedia were truely autoritative, but one more partly-correct source is not helpful, IMO. <span style="font-size: smaller;" class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/184.71.25.218|184.71.25.218]] ([[User talk:184.71.25.218|talk]]) 22:31, 21 August 2012 (UTC)</span><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
 
==Move discussion in progress==
Line 26 ⟶ 27:
 
: I don't understand what was wrong with the previous statement. <code>time_t</code> means ''"time since epoch"'' or ''"calendar time"'' in all contexts as per specification. The undefined thing is the format of the type, not what it represents. Thus since the previous definition doesn't specify anything about the format, it's still correct. [[User:1exec1|1exec1]] ([[User talk:1exec1|talk]]) 16:28, 23 November 2011 (UTC)
 
:: There is no requirement in C that <tt>time_t</tt> be implemented as time since an epoch. ([[Posix]] requires this, but not C.) I've [https://en.wikipedia.org/w/index.php?title=C_date_and_time_functions&diff=691089863&oldid=667471187 updated several function descriptions] accordingly. —[[User:scs|Steve Summit]] ([[User talk:scs|talk]]) 16:14, 17 November 2015 (UTC)
 
== Proposed rename ==
Line 50 ⟶ 53:
 
: Second, I never claimed the void cast to be required — I wrote ''should'', indicating its optional nature. Such void casts are deemed to be a good practice, because just by glancing at code you can easily tell which calls′ return values are ignored. It is a heavily used (by industry, yeah) convenience technique of the same order as prefixing struct/union member names with struct/union′s shortened name, for example:
<sourcesyntaxhighlight lang="c">struct iovec {
void *iov_base;
size_t iov_len;
};</sourcesyntaxhighlight>
: But okay, your point here is reasonable, so let′s keep the cast out and leave it to industry. I agree with your compilation and invocation point too — I tend to forget that non-UNIX operating systems exist, my bad.
 
Line 73 ⟶ 76:
 
: So if you want to change the indentation style used here, the usual procedure involving such comparatively major changes is to go to [[Wikipedia_talk:WikiProject Computing]] or [[Talk:C programming language]] and propose the change. But I probably should warn you to be prepared for a long flamewar, since this is what most of similar discussions become. Until there's consensus for a new indentation style, it should stay as is. [[User:1exec1|1exec1]] ([[User talk:1exec1|talk]]) 16:42, 18 March 2012 (UTC)
 
== Leap seconds? ==
 
Does the value of time_t include leap seconds? <span style="font-size: smaller;" class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/82.139.81.0|82.139.81.0]] ([[User talk:82.139.81.0|talk]]) 06:27, 4 June 2013 (UTC)</span><!-- Template:Unsigned IP --> <!--Autosigned by SineBot-->
 
:No. Applications frequently assume that days are exactly 86400 seconds long. Leap seconds are implemented by "stretching" one time_t second over two real seconds. -- [[user:intgr|intgr]]&nbsp;<small>[[user talk:intgr|[talk]]]</small> 08:02, 4 June 2013 (UTC)
 
:<tt>time_t</tt> does not ''typically'' reflect leap seconds, although in principle it could.
:(With that said, [[Posix]] requires that <tt>time_t</tt> not reflect leap seconds, which is one reason most implementations don't.)
: [But with that said, I believe that computer systems could handle leap seconds much more cleanly ''if'' <tt>time_t</tt> did explicitly reflect leap seconds, but that's another story.] —[[User:scs|Steve Summit]] ([[User talk:scs|talk]]) 16:20, 17 November 2015 (UTC)
== Completeness ==
The information is also incomplete. It only discusses those functions that deal with second precision. I came here hoping to find useful information for micro- or nanosecond double values, not merely int equivalents. <!-- Template:Unsigned --><small class="autosigned">—&nbsp;Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User: 71.179.41.98| 71.179.41.98]] ([[User talk: 71.179.41.98#top|talk]] • [[Special:Contributions/ 71.179.41.98|contribs]]) </small>
 
:New topics go at the bottom of the talk page. Each topic should have its own title. Each comment should be signed by placing 4 tilde characters at the end (ie <nowiki>~~~~</nowiki>).
 
:This page covers all the functions of the ''standard'' C library. The standard C library only goes down to seconds. Anything more precise is handled by extensions or alternatives to the standard C library and is therefore not meant to be covered in this article. <span style="border:1px solid blue;border-radius:4px;color:blue;box-shadow: 3px 3px 4px grey;">[[User:Stepho-wrs|'''&nbsp;Stepho&nbsp;''']]&nbsp;<span style="font-size:xx-small; vertical-align:top">[[User Talk:Stepho-wrs|talk]]&nbsp;</span></span> 20:43, 22 April 2020 (UTC)
 
== India Education Program course assignment ==
[[File:Wikipedia-Ambassador-Program-Logo.png|50px]] This article was the subject of an educational assignment at College Of Engineering Pune supported by [[Wikipedia:Education program/Ambassadors|Wikipedia Ambassadors]] through the [[Wikipedia:India Education Program|India Education Program]]&#32;during the 2011 Q3 term.&#32;Further details are available [[Wikipedia:India Education Program/Courses/Fall 2011/Data Structures and Algorithms|on the course page]].[[Category:India Education Program student projects, 2011 Q3|{{PAGENAME}}]] [[Category:India Education Program student projects]]
 
{{small|The above message was substituted from {{tlc|IEP assignment}} by [[User:PrimeBOT|PrimeBOT]] ([[User talk:PrimeBOT|talk]]) on 20:07, 1 February 2023 (UTC)}}