OSDN Git Service

MacGui: correct month output in the names of the individual encode logs
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 4 Dec 2008 18:58:03 +0000 (18:58 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 4 Dec 2008 18:58:03 +0000 (18:58 +0000)
- Duh! In struct tm,  tm_mon is the month number from 0 to 11, so we needed to be using tm_mon + 1

git-svn-id: svn://localhost/HandBrake/trunk@2005 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/HBOutputPanelController.m

index e504a5f..c22209c 100644 (file)
     /* We need to get the current time in YY-MM-DD HH-MM-SS format to put at the beginning of the name of the log file */
     time_t _now = time( NULL );
     struct tm * now  = localtime( &_now );
-    NSString *dateForLogTitle = [NSString stringWithFormat:@"%02d-%02d-%02d %02d-%02d-%02d",now->tm_year + 1900, now->tm_mon, now->tm_mday,now->tm_hour, now->tm_min, now->tm_sec]; 
+    NSString *dateForLogTitle = [NSString stringWithFormat:@"%02d-%02d-%02d %02d-%02d-%02d",now->tm_year + 1900, now->tm_mon + 1, now->tm_mday,now->tm_hour, now->tm_min, now->tm_sec]; 
     
     /* Assemble the new log file name as YY-MM-DD HH-MM-SS mymoviename.txt */
     NSString *outputDateFileName = [NSString stringWithFormat:@"%@ %@.txt",dateForLogTitle,[[outputFileForEncode lastPathComponent] stringByDeletingPathExtension]];