Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #37 - Fix RFC 3164 date padding: use for padding single digit day of month #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cyrille-leclerc
Copy link
Contributor

Fix #37 - Fix RFC 3164 date padding: use " " for padding day of month instead of using "0".

See https://tools.ietf.org/html/rfc3164#page-10

The TIMESTAMP field is the local time and is in the format of "Mmm dd
   hh:mm:ss" (without the quote marks) where:

         Mmm is the English language abbreviation for the month of the
         year with the first character in uppercase and the other two
         characters in lowercase.  The following are the only acceptable
         values:

         Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec

         dd is the day of the month.  If the day of the month is less
         than 10, then it MUST be represented as a space and then the
         number.  For example, the 7th day of August would be
         represented as "Aug  7", with two spaces between the "g" and
         the "7".

@cyrille-leclerc cyrille-leclerc force-pushed the fix-rfc-3164-date-padding branch from d9cb442 to fb0a208 Compare March 4, 2020 18:24
@cyrille-leclerc cyrille-leclerc changed the title Fix #37 - Fix RFC 3164 date padding: use for padding day of month… Fix #37 - Fix RFC 3164 date padding: use for padding single digit day of month Mar 4, 2020
cal.set(Calendar.MILLISECOND, 0);

System.out.println(SyslogMessage.rfc3339DateFormat.format(cal.getTime()));
System.out.println(cal.getTimeInMillis());
// System.out.println(SyslogMessage.rfc3339DateFormat.format(cal.getTime()));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

messageSender.setSyslogServerPort(46022);

// messageSender.setSyslogServerHostname("logs2.papertrailapp.com");
// messageSender.setSyslogServerPort(46022);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove comment

Copy link

@bsigouin bsigouin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than comment to be remove well done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC 3164 dates with single digit day should pad with instead of 0
2 participants