Skip to content

Instantly share code, notes, and snippets.

View mattcanty's full-sized avatar
:octocat:
Hello GitHub

Matt Canty mattcanty

:octocat:
Hello GitHub
View GitHub Profile
mongodump
net stop MongoDB
rmdir C:\data\db /S /Q
mkdir C:\data\db
net start MongoDB
mongorestore
rmdir dump /S /Q
@mattcanty
mattcanty / ConvertLocalBritishTimeToUtc
Last active August 29, 2015 14:01
Given a local british datetime, convert to UTC - take off an hour in summer
public static class DateTimeExtensions
{
private static readonly TimeZoneInfo TimeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time");
public static DateTime ConvertLocalBritishTimeToUtc(this DateTime dateTime)
{
var isSummer = TimeZoneInfo.IsDaylightSavingTime(dateTime);
if (isSummer)
{