Skip to content

Commit

Permalink
use DateTime.Parse()
Browse files Browse the repository at this point in the history
  • Loading branch information
limenet committed Jun 13, 2017
1 parent 3431e47 commit 718c7db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion PrinterAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ class PrinterAPI
private string timestamp;
private int count;

private string timestampFormat = "dd.MM.yyyy HH:mm";

public PrinterAPI(string title, string barcode, string timestamp = null, int count = 1)
{
this.title = title;
this.barcode = barcode;
this.timestamp = timestamp != null ? timestamp : DateTime.Now.ToString("dd.MM.yyyy HH:mm");
this.timestamp = timestamp != null ? DateTime.Parse(timestamp).ToString(timestampFormat) : DateTime.Now.ToString(timestampFormat);
this.count = count;
}

Expand Down

0 comments on commit 718c7db

Please sign in to comment.