mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
THRIFT-3132: Java generator will properly format date in @Generated
Client: Java Patch: Stig Bakken <stig@zedge.net> This closes #484
This commit is contained in:
parent
dfc22ad205
commit
2a15b99372
@ -23,6 +23,7 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <cctype>
|
||||
@ -36,6 +37,8 @@
|
||||
using std::map;
|
||||
using std::ofstream;
|
||||
using std::ostringstream;
|
||||
using std::setfill;
|
||||
using std::setw;
|
||||
using std::string;
|
||||
using std::stringstream;
|
||||
using std::vector;
|
||||
@ -5090,7 +5093,9 @@ void t_java_generator::generate_javax_generated_annotation(ofstream& out) {
|
||||
time_t seconds = time(NULL);
|
||||
struct tm* now = localtime(&seconds);
|
||||
indent(out) << "@Generated(value = \"" << autogen_summary() << "\", date = \""
|
||||
<< (now->tm_year + 1900) << "-" << (now->tm_mon + 1) << "-" << now->tm_mday << "\")"
|
||||
<< (now->tm_year + 1900)
|
||||
<< "-" << setfill('0') << setw(2) << (now->tm_mon + 1)
|
||||
<< "-" << setfill('0') << setw(2) << now->tm_mday << "\")"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user