Skip to content

Commit

Permalink
GenerateOAuthTimestamp (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
prabirshrestha committed May 12, 2012
1 parent 5dfcbbd commit 8f8a1c0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion HttpHelper.cs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2243,8 +2243,14 @@
return Convert.ToBase64String(Encoding.UTF8.GetBytes(DateTime.Now.Ticks.ToString(CultureInfo.InvariantCulture)));
}

/// <summary>
/// Generate OAuth time stamp
/// </summary>
public static string GenerateOAuthTimestamp()
{
return Convert.ToInt64((DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds).ToString(CultureInfo.InvariantCulture);
}


#endif

#endregion
Expand Down

0 comments on commit 8f8a1c0

Please sign in to comment.