CFAbsoluteTimeGetGregorianDate
グレゴリオ暦に変換します
CFGregorianDate CFAbsoluteTimeGetGregorianDate ( CFAbsoluteTime at , CFTimeZoneRef tz );
解説
グレゴリオ暦に変換します。
返り値
引数
( CFAbsoluteTime )at
( CFTimeZoneRef )tz
クラス
CFDate
Function
使用可能
10.0
参照
例文
#include <CoreFoundation/CoreFoundation.h> int main (int argc, const char * argv[]) { CFAbsoluteTime timeNow = CFAbsoluteTimeGetCurrent(); CFGregorianDate current = CFAbsoluteTimeGetGregorianDate( timeNow, NULL ); double dsecs = floor(current.second); unsigned int second = (unsigned int)dsecs; double milliseconds = (current.second - dsecs) * 1000.0; CFStringRef theString = CFStringCreateWithFormat (kCFAllocatorDefault,NULL,CFSTR("%@ %d.%d.%d %d:%d:%d.%u\n"), CFSTR("Now"),current.year, current.month, current.day, current.hour, current.minute, second, (unsigned int)milliseconds); CFShow(theString); return 0; }