+/*
+=========
+VM_strftime
+
+string strftime(float uselocaltime, string[, string ...])
+=========
+*/
+void VM_strftime(void)
+{
+ time_t t;
+ struct tm *tm;
+ char fmt[VM_STRINGTEMP_LENGTH];
+ char result[VM_STRINGTEMP_LENGTH];
+ VM_VarString(0, fmt, sizeof(fmt));
+ t = time(NULL);
+ if (PRVM_G_FLOAT(OFS_PARM0))
+ tm = localtime(&t);
+ else
+ tm = gmtime(&t);
+ if (!tm)
+ {
+ PRVM_G_FLOAT(OFS_RETURN) = 0;
+ return;
+ }
+ strftime(result, sizeof(result), fmt, tm);
+ PRVM_G_FLOAT(OFS_RETURN) = PRVM_SetTempString(result);
+}
+