Espaces de noms
Variantes
Affichages
Actions

std::asctime

De cppreference.com
< cpp‎ | chrono‎ | c

 
 
 
 
C-style utilitaires date et l'heure
Fonctions
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La manipulation du temps
Original:
Time manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
difftime
time
clock
Les conversions de format
Original:
Format conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
asctime
ctime
strftime
wcsftime
gmtime
localtime
mktime
Constantes
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
CLOCKS_PER_SEC
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
tm
time_t
clock_t
 
Defined in header <ctime>
char* asctime( const std::tm* time_ptr );
Convertit donné std::tm calendrier en une représentation textuelle .
Original:
Converts given calendar time std::tm to a textual representation.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La chaîne résultante a le format suivant:
Original:
The resulting string has the following format:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Www Mmm dd hh:mm:ss yyyy
  • Www - le jour de la semaine (un des Mon, Tue, Wed, Thu, Fri, Sat, Sun) .
    Original:
    Www - the day of the week (one of Mon, Tue, Wed, Thu, Fri, Sat, Sun).
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • Mmm - le mois (l'un des Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) .
    Original:
    Mmm - the month (one of Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec).
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • dd - le jour du mois
    Original:
    dd - the day of the month
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • hh - heures
    Original:
    hh - hours
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • mm - minutes
    Original:
    mm - minutes
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ss - secondes
    Original:
    ss - seconds
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • yyyy - ans
    Original:
    yyyy - years
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
La fonction de localisation ne supporte pas .
Original:
The function does not support localization.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Sommaire

[modifier] Paramètres

time_ptr -
pointeur vers un objet std::tm spécifiant la durée d'impression
Original:
pointer to a std::tm object specifying the time to print
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Retourne la valeur

Pointeur vers une chaîne de caractères terminée par NULL statique en maintenant la représentation textuelle de la date et de l'heure. La chaîne peut être partagé entre std::asctime et std::ctime, et peut être écrasée à chaque appel de l'une de ces fonctions .
Original:
Pointer to a static null-terminated character string holding the textual representation of date and time. The string may be shared between std::asctime and std::ctime, and may be overwritten on each invocation of any of those functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Notes

Cette fonction retourne un pointeur vers des données statiques et n'est pas thread-safe. POSIX marque cette fonction obsolète et recommande std::strftime la place .
Original:
This function returns a pointer to static data and is not thread-safe. POSIX marks this function obsolete and recommends std::strftime instead.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Le comportement est indéfini si la chaîne de production serait plus long que 25 caractères, si timeptr->tm_wday ou timeptr->tm_mon ne sont pas dans les limites prévues, ou si timeptr->tm_year dépasse INT_MAX-1990 .
Original:
The behavior is undefined if the output string would be longer than 25 characters, if timeptr->tm_wday or timeptr->tm_mon are not within the expected ranges, or if timeptr->tm_year exceeds INT_MAX-1990.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Certaines implémentations de gérer timeptr->tm_mday==0 comme signifiant le dernier jour du mois précédent .
Original:
Some implementations handle timeptr->tm_mday==0 as meaning the last day of the preceding month.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Exemple

#include <ctime>
#include <iostream>
 
int main()
{
    std::time_t result = std::time(NULL);
    std::cout << std::asctime(std::localtime(&result));
}

Résultat :

Tue Dec 27 16:45:52 2011

[modifier] Voir aussi

convertit un objet time_t à une représentation textuelle
Original:
converts a time_t object to a textual representation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]
convertit un objet à tm représentation textuelle personnalisée
Original:
converts a tm object to custom textual representation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction) [edit]
(C++11)
formats et émet une valeur de date / heure selon le format spécifié
Original:
formats and outputs a date/time value according to the specified format
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction générique) [edit]
C documentation for asctime