Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8457135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:43:55+00:00 2026-06-10T12:43:55+00:00

I am trying to translate a message generated using C# to JAVA. As a

  • 0

I am trying to translate a message generated using C# to JAVA. As a first step, i generated proto file and this is what i got

package Om.Business.Scanner;

message ScannerActivityDetail {
   optional string ActivityId = 1;
   optional string ContextId = 2;
   optional int32 ActivityStart = 3;
   optional bcl.DateTime ActivityEnd = 4;
}

How do i interpret bcl.DateTime in java world?

I am using protobuf-net and trying to de-serialize message generated by C# app.

Thanks in advance for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:43:57+00:00Added an answer on June 10, 2026 at 12:43 pm

    Looking at bcl.proto, it should be pretty straightforward. Create a Map<DateTime.TimeSpanScale, TimeUnit> in the obvious way, then:

    public static Date toDate(bcl.DateTime proto) {
        TimeUnit unit = SCALE_TO_UNIT_MAP.get(proto.getScale());
        if (unit == null) {
            throw new IllegalArgumentException("Invalid scale: " + proto.getScale());
        }
        long millis = unit.toMillis(proto.getValue());
        return new Date(millis);
    }
    

    You could use Joda Time‘s DateTime type in exactly the same way, as it has a constructor accepting a long too. (You might want to think about which time zone to specify though…)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse the following URI : http://translate.google.com/#zh-CN|en|你 but got this error message
I am trying translate this Python code to Java from the presentation Building Scalable,
when trying to translate the confirmation message to Norwegian i get the following error:
Im trying to translate an object without using glTranslate(). I have searched through web
I am trying to translate a subset of Java to c++. How can i
So I'm trying to send an xml-rpc message to moses xml-rpc server in Java,
I am trying to translate the form_errors in a Symfony2 generated Forms, but I
I'm trying to translate text out of a template file in a Pyramid project.
I'm trying to use message placeholders with Twig template engine. My navlist.it.yml stores this
I'm trying to translate parse a RTF formatted message (I need to keep the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.