Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I wanted to learn everything about how to work with dates and time, in relation with php and sql (mysql).

 

I thought a good place to start would be to create an online calendar application that would allow the user to place events in the represent date.

and for others to be able to view that calendar through another page

 

Anyone know any good material out there that could help me do this and learn all about using the dates and times functions correctly with php, all i seem to find is the calendar itself with no explanation of how to combine the calendar and any form data placed into the database.

 

or i find a company with a pre built one.
i want to build it from scratch

 

any material you personally recommend would be appreciated i.e books, videos, articles, blog posts... anything really ill read it all

P.s im not a beginner at php or mysql.. starting to get this ish down so throw anything my way.

  • Author

Well that's nice but, i wanted to learn how to make it from scratch my self

 

The calendar is just a project to learn from
You don't know any resources, i.e books. That specialize or has a big section on php, mysql and date functions.

 

I guess i can always look at the source code...

Yes, start with the php documentation and try out the apis, probably starting here.

 

For my current project I actually need dates earlier than 1000AD, which is the earliest date mysql allows in its DATE type. Using an integer value, in the format of YYYYMMDD - for example 20130609 representing today - allows accurate date comparison, and I can go back as far as I want to year zero.

 

For time values I store the time as seconds. I have two functions, secondsToTime and timeToSeconds, which are fairly simple to write.

 

The last place I worked (a very large financial software company) followed this practice in general, so that's where I picked it up. If you want to support more sophisticated functionality, it may be better to leverage an existing api, for example if you need to support timezones, daylight savings (which differs by country) - this gets painful very quickly!

 

However most of the time it's faster and simpler to store these two things as separate integers, and manage them on your own.

  • 2 weeks later...

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.