Search
 
SCRIPT & CODE EXAMPLE
 

C

c get current month, year, day

#include <windows.h> // use to define SYSTEMTIME , GetLocalTime() and GetSystemTime()
#include <stdio.h> // For printf() (could otherwise use WinAPI equivalent)

int main(void) { // Or any other WinAPI entry point (e.g. WinMain/wmain)

    SYSTEMTIME t; // Declare SYSTEMTIME struct

    GetLocalTime(&t); // Fill out the struct so that it can be used

    // Use GetSystemTime(&t) to get UTC time 

    printf("Year: %d, Month: %d, Day: %d, Hour: %d, Minute:%d, Second: %d, Millisecond: %d", t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond, t.wMilliseconds); // Return year, month, day, hour, minute, second and millisecond in that order

    return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: addition.c 
C :: C scanf() to read a string 
C :: read from stdin c 
C :: initializa 2d array c 
C :: get float in c 
C :: arduino sketch structure 
C :: compare c strings 
C :: sqlserver insert with set identity 
C :: how i send custom data in model field rest_framework serializer 
C :: bootsrap textbox 
C :: c program that replace vowels in a string with char 
C :: how to call function after some time in vue.js 
C :: c convert string to size_t 
C :: lichess puzzles 
C :: int data types in c 
C :: c print 
C :: set all pins as output for loop 
C :: implement crc using c language 
C :: access 2d array with pointer c 
C :: c add char to char array 
C :: fwrite c 
C :: rust unit test display 
C :: example of header file in c 
C :: c code recursive function to print numbers between two numbers 
C :: Command to compile and execute a c file program consecutively 
C :: how to find adam number uasing loop in C 
C :: parcel-bundler include image files 
C :: nested if example in c 
C :: kleiner gleich zeichen MAC 
C :: 25802 WARNING: lib not found: _pywrap_tensorflow_internal.pyd dependency of D:Devtoolsminicondalibsite-packages ensorflowpythonclient\_pywrap_tf_session.pyd 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =