Jump to content

JasonLewis

Members
  • Posts

    3,347
  • Joined

  • Last visited

Everything posted by JasonLewis

  1. Hey guys, looks great. Well done to those that did the change over. Not very active anymore but it's great to see the community continue to grow.
  2. Very interesting. Not that I frequent here anymore (I'm sorry!) I'll be interested to see how it all goes. I'll check in from time to time. After all.. this is probably my longest standing account on the internet. Good luck to you!
  3. I've come to the conclusion that Twitter most likely uses JavaScript to update their dates. You can check this by changing your computers date/time and refreshing the page. As an educated guess I'd say Twitter keeps the timezone setting as a server-side fall back in case something goes wrong client-side. Fair enough. I've gone the same way. I'm using PHPDate for jQuery to make formatting my dates easier and also using this conversion script found on StackOverflow. This has turned into a client-side thing now. Ah well, hopefully this can help someone.
  4. Developing apps is great until I have to start dealing with blasted timezones. For some reason this aspect of it always does my head in. At the moment I'm storing all dates in the DB as GMT with the format Y-m-d H:i:s. I figure it's good to be consistent and store dates in GMT then convert to the users desired timezone. So I allow users to choose there timezone, based off the defined PHP timezones that can be used with the DateTimeZone class. My problem, however, arises with the whole syncing of times. Let's say I post something right now. The date gets stored in in the database as: 2012-04-14 02:35:49 Now I'm in GMT +10 (possibly the greatest of timezones ), so I've set my timezone in my settings as Australia/Melbourne and when displaying date/times locally I do something like this: public static function local($user, $date, $format = 'F j, Y, h:ia') { $date = new DateTime($date); return $date->setTimezone(new DateTimeZone($user->timezone))->format($format); } So running the stored date above through my method gives me a date like this: April 14, 2012, 12:35pm Awesome. My question is: I noticed that on say, Twitter, when you change your timezone your tweet dates don't change. They remain as the date/time of my actual timezone, regardless of what I set it too. With my implementation however, if I change my timezone to GMT +12 (Fiji) my post is now posted at: April 14, 2012, 02:35pm So is what I'm doing right? My head has about had it. Thanks.
  5. Just an update for people. I'm approaching this like I've posted above. I'll be making use of Node/Socket.io/Redis (pub/sub feature) to handle real-time updates for notifications and other related components. Once I get it working properly I'll post how I did it all for future reference.
  6. Thanks for your reply kicken! What I'm getting at is this. Say I post a new update or something, when that update is inserting into the database should I push the notification through to socket.io which then broadcasts that notification to the connected clients? Does that sound feasible? What I want to try to avoid is polling the database every couple of seconds to check for new notifications. I'm using MySQL and I've read that other database's handle that sort of thing a tad better. Edit: This is a quote from another forum: I can make sense of that... I'll just need to implement Redis since I don't have it at the moment.
  7. I'm looking for advice at the moment on achieving real-time notifications using a mix of PHP, NodeJS and socket.io. At the moment I have done next to nothing with Node and socket.io so I'm at a loss with the best way to achieve this. I've done some basically listening and what not but nothing extreme. For now my questions are: 1. How will socket.io know of new notifications, should PHP be responsible for sending the data (say a post was created) to socket.io and from there broadcasting to connected clients? 2. How does socket.io know which clients want the notifications? I'm really not sure what else. This is all a bit much for me at the moment. I just can't get my head around how the notifications will be distributed. Any advice would be greatly appreciated. I don't expect a detailed walk through, just a push in the right direction or some knowledge on how it all meshes. Cheers.
  8. I'm currently using Notepad++ for a fairly big project. I admit, it's not the best for it. Takes a bit more time to get around, but I like it. I'm thinking of upgrading to something which manages projects a bit better. Have to see how I go..
  9. Nah mate, could possibly be a plugin for it, doubt it though. Notepad++ only shows you the code, which is what most people are after with a code editor. To view your page, open it up in a browser.
  10. +1 for Notepad++, my favourite so far. I found Eclipse to be a memory hog and become relatively slow. Also can take a while to load up. Notepad++ is fast, efficient and has many good plug-ins and a *fairly* good community.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.