search for: 02d

Displaying 20 results from an estimated 157 matches for "02d".

Did you mean: 02
2010 Apr 14
1
[PATCH] Change the date format used in RHEV OVF output
.../VirtV2V/Target/RHEV.pm index 911e5c6..f14c54f 100644 --- a/lib/Sys/VirtV2V/Target/RHEV.pm +++ b/lib/Sys/VirtV2V/Target/RHEV.pm @@ -543,10 +543,7 @@ sub create_guest $memsize = int($memsize / 1024); # Generate a creation date - my $now = gmtime(); - my $vmcreation = sprintf("%02d/%02d/%d %02d:%02d:%02d", - $now->mday(), $now->mon() + 1, $now->year() + 1900, - $now->hour(), $now->min(), $now->sec()); + my $vmcreation = _format_time(gmtime()); my $osuuid = Sys::VirtV2V::Target::RHEV::UUID...
2007 May 28
1
[1.2.18] Wrong steps in extensions.conf?
...wser = LWP::UserAgent->new; my $url = "http://www.acme.com/input.php?"; $url .= "name=" . $safe_cidname . "&"; $url .= "number=" . $cidnum . "&"; ($min, $hrs, $day, $month, $year) = (localtime) [1,2,3,4,5]; $currentdate = sprintf("%02d/%02d/%02d", $day, $month+1, $year % 100); $currenttime = sprintf("%02d:%02d", $hrs,$min); $url .= "date=" . $currentdate . "&"; $url .= "time=" . $currenttime; #print $url . "\n"; my $response = $browser->get( $url ); die "Can'...
2011 Oct 13
0
1) A memory leak in drivers/rhino.c 2) Wunused-but-set-variable.patch
...ernal variables */ /* package handshake variables */ @@ -142,19 +136,9 @@ static unsigned char RecPack[37]; #ifdef PORTUGUESE #define M_UNKN "Mod?lo rhino desconhecido\n" #define NO_RHINO "Rhino n?o detectado! abortando ...\n" -#define UPS_DATE "Data no UPS %4d/%02d/%02d\n" -#define SYS_DATE "Data do Sistema %4d/%02d/%02d dia da semana %s\n" -#define ERR_PACK "Pacote errado\n" -#define NO_EVENT "N?o h? eventos\n" -#define UPS_TIME "Hora interna UPS %0d:%02d:%02d\n" #else #define M_UNKN "Unknown rh...
2007 Nov 02
1
R timeDate does not allow seconds?
...ponse. Your idea makes a lot of sense to me, but I've been unable to get seconds to work. I ended up with this format finally: "2007-10-31_16:20:22" Problem is I am unable to get it recognized as a date using timeDate(): R> timeDate(as.character(inputdate),format="%Y-%02m-%02d_%02H.%02M.%02S") Error in if (regexpr("/....", charvec[1])[[1]] > 0) return("%m/%d/%Y") : missing value where TRUE/FALSE needed The R-help archives said something about non-standard formats casuing a problem, but I believe (short of the underscore) that its the...
2009 Jun 05
3
from 3 numeric variables to a string
Hi there, I have 3 numeric variables: day (e.g., 05), month (e.g., 06), year (e.g., 2009). I would like to create a (string) variable of the following form: month/day/year (e.g., 06/05/2009). I would be grateful to anyone who could point me toward a solution. Sincerely, Marc =================== Marc B?lisle Professeur agr?g? Chaire de recherche du Canada en ?cologie spatiale et en ?cologie
2006 Jul 04
4
adding 0 to beginning of a number
Hi Is there a quick way to add 0 to the beginning of a number if it only has one digit? ie 1 should be 01 11 should stay as 11 (These int''s can be transferred to a string) Thanks -- Posted via http://www.ruby-forum.com/.
2004 Jul 18
2
gray background in png
Hi all, I'm having a problem creating png images with trellis.device. I would like to create many plots with a white background using a sequence number in the file argument (i.e. "%02d"). The first plot is as expected with a white background. However, the second and all subsequent plots have a gray background. I would like all plots to have a white (or transparent) background. Below is an example: library(lattice) z <- expand.grid(A = LETTERS[1:8], B = letters[1:6]) z...
2019 Oct 03
2
[PATCH] Avoiding Dereferencing of NULL pointer
...ype, u_int32_t otests, u_int32_t otries, u_int32_t osize, u_int32_t ogenerator, BIGNUM * omodulus) { - struct tm *gtm; + struct tm *gtm = NULL; time_t time_now; int res; time(&time_now); gtm = gmtime(&time_now); + if (!gtm) + return (-1); res = fprintf(ofile, "%04d%02d%02d%02d%02d%02d %u %u %u %u %x ", gtm->tm_year + 1900, gtm->tm_mon + 1, gtm->tm_mday, -- 2.7.4
2009 Feb 04
2
[nut-commits] svn commit r1765 - in trunk: . drivers man
...ng. > 899 dstate_setinfo("ups.StatusUPS", "%08lX", > ups.StatusUPS) ; > 900 dstate_setinfo("ups.ShortStatus", "%04X", > ups.ShortStatus) ; > 905 dstate_setinfo("ups.time", "%02d:%02d:%02d", > p[6], p[7], p[8]) ; The above is a waste of effort. By the time upsdrv_shutdown() runs, the server won't be listening anymore. > 958 addvar(VAR_VALUE, "ups.delay.shutdown", "Override > shutdown delay (120s)"); > 959 ad...
2009 Jan 07
3
[LLVMdev] LLVM optmization
...cs(x) (x) #define num_th 100 unsigned long milisecs() { return getmilisecs(tfim-tini);}; unsigned long secs() { return milisecs()/1000;}; const char *spenttime () { static char buffer[64]; unsigned long systime = secs(); unsigned long milisectime = milisecs()%1000; sprintf(buffer,"%02d:%02d:%02d:%03d",systime/3600,(systime%3600)/60,(systime%3600)%60,milisectime); return (const char*) buffer; }; //fim cronometro int main(int a, char **b) { int i; DWORD iThreadId; HANDLE mainThread[num_th]; tfim = 0; tini = GetTickCount(); for(i=0; i< num_th;i++) mainThread[i] =...
2009 Oct 08
6
Eager Loading a Relationship That Has No PK/FK
...A Segment is "linked" to Media by Media.name, which is the result of concatenating Segment.name and Segment.part. As I said there are is no PK/PK relation so the actual Segment class looks like this: class Segment < AR::Base def media @media ||= Media.find_by_name("#{name}%02d" % part) end end This leaves me stuck with a N+1 select problem because I can''t say: Segment.all :include => :media or Show.all :include => {:segment=>:media} How to get around the N+1? select problem and eager load Media? In the case of Show.all, Show and Media have...
2004 Apr 10
0
patches for copying atimes
...rve_perms = 0; +static int display_atime = 0; static void failed (char const *what, char const *where) @@ -57,14 +59,30 @@ exit (1); } +static void storetime(char *dest, + time_t t) +{ + if (t) { + struct tm *mt = gmtime(&t); + sprintf(dest, "%04d-%02d-%02d %02d:%02d:%02d", + mt->tm_year + 1900, + mt->tm_mon + 1, + mt->tm_mday, + mt->tm_hour, + mt->tm_min, + mt->tm_sec); + } else { + strcpy(dest, " "); + } +} static void list_file (const char *fname) { STRUCT_STAT buf; char...
2007 Aug 01
0
[PATCH] prevent negative "time left" values with --progress when file grows
...c/progress.c,v retrieving revision 1.23 diff -u -r1.23 progress.c --- progress.c 10 Jul 2007 13:55:49 -0000 1.23 +++ progress.c 1 Aug 2007 12:43:33 -0000 @@ -104,9 +104,16 @@ stats.num_files); } else strlcpy(eol, "\r", sizeof eol); - rprintf(FCLIENT, "%12s %3d%% %7.2f%s %4d:%02d:%02d%s", - human_num(ofs), pct, rate, units, - remain_h, remain_m, remain_s, eol); + if (remain < 0) + /* file size increased on sending side during xfer */ + /* so prevent negative times like 0:-1:-49 */ + rprintf(FCLIENT, "%12s %3d%% %7.2f%s ??:??:??%s", + human...
2002 Oct 28
2
root prexec/postexec & login scripts
I have a perl script that I'd like to use to create windows 9x login scripts at login time but I cannot get the process to work right. I have RedHat 7.3 (actually the k12ltsp v2.1.0 which is a modified RH7.3) set up as a domain controller which is working well. Manually created login scripts run fine on the workstations at login. I'm using a netlogon script I found at
2011 Apr 21
2
Error in png: unable to start png() device
...e with them yesterday. I just downloaded R 2.13.0 this morning, and was able to make some pngs earlier this morning. Now I am trying to remake them, but get the same error message I got yesterday: > u='in' > w=10.5 > h=8 > png('winbugs changepoint graphs ind hibs gt 400 p%02d.png',height=h,width=w,res=300,units=u) Error in png("winbugs changepoint graphs ind hibs gt 400 p%02d.png", height = h, : unable to start png() device In addition: Warning messages: 1: In png("winbugs changepoint graphs ind hibs gt 400 p%02d.png", height = h, : Unable...
2003 Mar 22
1
Desperate! passwd sync problem...please help!
Hello, I am running Samba 2.2.3a-6 on a Debian(testing) machine. It is running as a PDC for 15 Win2K(SP2/3) systems. Everything runs beautifully except the users cannot change their passwds. When a user CTRL-ALT-DEL and change passwd they ultimately get a messages stating that the old passwd is incorrect.... If I log into a shell as a user on the system and invoke smbpasswd, It goes through all
2003 Apr 20
4
${EPOCH} and ${DATETIME} patch
...cmp(var, "EPOCH")) { + snprintf(workspace, workspacelen -1, "%u",(int)time(NULL)); + *ret = workspace; + } else if (!strcmp(var, "DATETIME")) { + thistime=time(NULL); + localtime_r(&thistime, &brokentime); + snprintf(workspace, workspacelen -1, "%02d%02d%04d-%02d:%02d:%02d", + brokentime.tm_mday, + brokentime.tm_mon+1, + brokentime.tm_year+1900, + brokentime.tm_hour, + brokentime.tm_min, + brokentime.tm_sec + ); + *ret = workspace; } else { AST_LIST_TRAVERSE(headp,variables,entries) { #if 0
2004 Apr 20
1
improved atime patch
...rve_perms = 0; +static int display_atime = 0; static void failed (char const *what, char const *where) @@ -57,14 +59,30 @@ exit (1); } +static void storetime(char *dest, + time_t t) +{ + if (t) { + struct tm *mt = gmtime(&t); + sprintf(dest, "%04d-%02d-%02d %02d:%02d:%02d", + mt->tm_year + 1900, + mt->tm_mon + 1, + mt->tm_mday, + mt->tm_hour, + mt->tm_min, + mt->tm_sec); + } else { + strcpy(dest, " "); + } +} static void list_file (const char *fname) { STRUCT_STAT buf; char...
2009 Jun 10
1
Weird behavior in receive_data function
...Size = 1; > nBlock = 256; > nInterval = 4; > nAdjust = 256; > > printf("\nstart to build origin files!\n"); > ch = 0; > for(l = 0; l < count; l++) > { > memset(buffer,0, 256); > sprintf(buffer,"media-test-3MB-file/origin/test/test%02d.dat",l); > printf("writting %s \n",buffer); > fd = open(buffer, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR); > for(lll = 0; lll < nSize; lll++) > { > for(mmm = 0; mmm < nAdjust; mmm++) > { > for(nnn = 0; nnn < nBlock; nnn++) >...
2005 Dec 08
2
Confusing lock problem in rails
...lete_old @p = Pref.find_by_setting(''autodelete'') if @p and @p.value.to_i > 0 val = @p.value.to_i destroy_all(["found_on <= DATE_SUB(CURDATE(), INTERVAL ? DAY)", val]) end end def self.delete_before(params) date = sprintf("%04d-%02d-%02d", params[:foundon][:year], params[:foundon][:month], params[:foundon][:day]) deleted = Resume.destroy_all(["found_on <= ?", date]) optimize_index deleted.length end validates_uniqueness...