Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #5708
Closed
Open
Issue created Mar 25, 2020 by Administrator@rootContributor

[REQ] [Qt5][client][server] Use a particular DateTime format during saving model as a JSON string

Created by: goodicus

Is your feature request related to a problem? Please describe.

I'm using c++ Qt5 client and server in a network mediator application. The app receives JSONs, collects them and resends to the Java server using a schedule. The Java server is generated with OpenAPI also. The problem is there is a DateTime format mismatch between Qt5 [client/server] and JAVA.

  • Java server excepts Jsons with such DateTime format: with "2017-07-08T22:35:29.771Z" - suffix Z, means UTC time "2017-07-08T22:35:29+02:30" - time zone "2017-07-08T22:35:29.771+02:30" - with a suffix and a timezone
  • Qt5 generates by default in such way: " 2017-07-08T22:35:29" - withnout Z and a timezone.

Describe the solution you'd like

Currently, QDateTime transforms into a string using a Qt::ISODate format. QString toStringValue( const QDateTime& value ) { // ISO 8601 return value.toString( Qt::ISODate ); }

It would be useful for me to set a particular DateTime format option during code generation. Example for cpp-qt5-client: useQDateTimeFormat="yyyy-MM-ddTHH:mm:ss.zzzZ"; Smth like this: QString const DateTimeFormat = "yyyy-MM-ddTHH:mm:ss.zzzZ"; QString toStringValue( const QDateTime& value ) { return value.toString( QtDateTimeFormat ); }

Describe alternatives you've considered

Additional context

Assignee
Assign to
Time tracking