Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 162659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:25:49+00:00 2026-05-11T11:25:49+00:00

I am implemening simple file-sharing service. Currently I use a file-based database (as it

  • 0

I am implemening simple file-sharing service. Currently I use a file-based database (as it suits my needs).

   # somewhere in my cgi script    sub first_run     {       my $dbh = DBI->connect('dbi:DBM:');       $dbh = DBI->connect('dbi:DBM:', '', '',{ AutoCommit => 1, RaiseError => 1, f_dir=>$DATABASE_DIR} );       unless ($dbh)       {         print '<br>Cannot connect: $DBI::errstr';         return undef;       }       $dbh->do('CREATE TABLE uploads( user_name TEXT,         file_name TEXT,          upload_date TEXT ) ');       $dbh->disconnect( );     } 

As you can see I propose to store the upload timestamp as a string, since currently I only have to display it (suppose to use localtime() to get timestamp in a human readable format). But this seems to me somewhat bad. What if later I’ll want to show uploads from some period, etc.

What is the common way of storing timestamps in a DBM database without using third-party, CPAN modules? How can I pull them later and show them to the user (in my situation, convert back to string)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:25:50+00:00Added an answer on May 11, 2026 at 11:25 am

    Consider that storing UTC time is less ambiguous than storing local time. If you save a time at your computer in London and send me the file in Hong Kong, will I when I load the file in your program see the time you actually saved?

    Consider that in storing UTC time you have (at least) two choices: the formatted time string, or a count of numbers of (seconds/milliseconds/whatever) since a particular time (‘the epoch’). Presumably either format is isomorphic with the other, as there is a well-defined bi-directional conversion rom one to the other.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am implementing a very simple file database. I have 2 basic operations: void
I'm working on implementing a reasonably simple XML serializer/deserializer (log file parser) application in
Anyone knows a simple JavaScript library implementing the UNZIP algorithm? No disk-file access, only
Imagine two simple java applications. Both of them are implementing the same JAR file
I am implementing a simple application for expenses reporting.The application will use GAE. In
Basically, I would like a simple, easy, one-file way to parse an INI file
Here's a very simple java program to print the first line of a file:
What is the best approach for implementing a single-use password to download a file?
I'm studying the best data structures to implement a simple open-source object temporal database,
I am implementing a simple license-file system, and would like to know if there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.