Monthly Archives: June 2014
Firebug 2 is now available
Firebug v2 has been released. The new Firebug version adds support for Firefox 30 and up to Firefox 32.
For those that are unaware what Firebug is, Firebug is a Firefox plugin that enables you to edit, debug, and monitor CSS, HTML, and JavaScript live in any web page. A must have plugin for web developers that want to troubleshoot their websites under Firefox.
Firebug 2 introduces a few new features, such as:
- Syntax Highlighting
- Pretty Print
- DOM Events Inspector
- Searching in the HTML Panel
- Code Auto Completion
- JavaScript Expressions Inspector
- Console Log Grouping
- Inspect JavaScript Function Return Value
- Show/Hide Firebug Panels
- Displaying Original CSS Color Values
- Quickly create new HTML attribute
- Inspect Registered Mutation Observers
You can download Firebug 2 by clicking the button bellow.
Posted in Software Updates.
Tagged firebug, firebug 2, firefox, firefox plugin
Visual Studio 2014 Preview is now available
Microsoft has released a CTP (Community Technology Preview) version for their Visual Studio software.
This version is intended only for people that want to have access to the early stages of the new Visual Studio version and want to give their feedback to Microsoft. Since this is an early state of Visual Studio 2014 is it recommended to install the software in a virtual machine to avoid conflicts with any other versions of Visual Studio you might already have installed.
For more information check out the release notes for Visual Studio 2014 Preview.
Download Links:
Posted in Microsoft.
Tagged Microsoft, Visual Studio, Visual Studio 2014
Convert DateTime to Unix time in C#
I’ve been asked recently by a few people how to convert Unix time to DateTime format (and the other way around) so I decided to make a post about it explaining how Unix time works and provide a snippet to help people that want to convert DateTime to Unix time or vise versa.
Unix time is basically the number of seconds that have passed since 1/1/1970 00:00:00 (UTC). In order to convert a specific date and time to a Unix time value we will need to subtract the date above from the date we want to convert to Unix time.
Example:
1 2 3 4 5 6 7 8 9 10 11 | /// <summary> /// Convert a date time object to Unix time representation. /// </summary> /// <param name="datetime">The datetime object to convert to Unix time stamp.</param> /// <returns>Returns a numerical representation (Unix time) of the DateTime object.</returns> public static long ConvertToUnixTime(DateTime datetime) { DateTime sTime = new DateTime(1970, 1, 1,0,0,0,DateTimeKind.Utc); return (long)(datetime - sTime).TotalSeconds; } |
Now if we want to convert a Unix time value to a DateTime object the the principle is the same. We take the 1/1/1970 00:00:00 (UTC) date and add the value of the Unix time as seconds to that date. The result would be the actual DateTime of the Unix time stamp.
Example:
1 2 3 4 5 6 7 8 9 10 | /// <summary> /// Convert Unix time value to a DateTime object. /// </summary> /// <param name="unixtime">The Unix time stamp you want to convert to DateTime.</param> /// <returns>Returns a DateTime object that represents value of the Unix time.</returns> public static DateTime UnixTimeToDateTime(long unixtime) { DateTime sTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); return sTime.AddSeconds(unixtime); } |