**>Date: Wed, 23 Feb 2005 16:28:57 +0100 (CET) **>From: Peter Buki <[EMAIL PROTECTED]> **>Subject: Octstr to Unix timestamp converter function **>To: [email protected] **> **>Hi, **> **>Does anyone have an octstr function, which can convert a **>date string to unix timestamp (longint)? I would need it for **>converting the CIMD2 type timestamp (YYMMDDHHMMSS) to unix **>timestamp. **> **>As I am actually weak of C, it would take days for me. If **>anyone made something similar, I would hack it for my needs. **> **>I need it to pass the timestamp stored in the database **>towards the dlr-url.
Look at the [email protected] maillist: http://www.mail-archive.com/[email protected]/msg04106.html In step 3l), I provide guidelines to convert an YYYYMMDDHHMMSS Octstr to the localtime. For your case, you should extract only 2 characters for the year and omit the subtraction of 1900 from the year. Additionally, all the positional values should be 2 less than they are are now. If your CIMD2 server returns GMT time, just replace the timelocal() function with timegmt(). Oh, forgot, 't' variable is declared in step 3b). It's very useful to read both mailing list. Sometimes, technical questions are answered there with code examples. See ya... d.c.
