Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pike pike
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 107
    • Issues 107
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pikelang
  • pikepike
  • Issues
  • #4326

mktime() timestamp calculation

Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=4326

Reported by Erik Allemann erik@roxen.com

[RT#8983]

RTL having compatibility problems between 2.4 editserver and 4.5-rel2 frontends.

Code excerpt:

mapping mtime = localtime(time(1)) + ([ "min" : 0, "sec" : 0, "hour" : 0
]);
mtime->mday -= 2; // will cause a mtime->mday = -1;
int newtime = mktime(mtime);

write(ctime(newtime));

The code is supposed to calculate an timestamp (2 days) in the past. On pike 7.2 the resulting timestamp will be of February 27th, on pikes 7.4 and 7.6 the calculated timestamp will be March 2nd.

Assignee
Assign to
Time tracking